When you use static template without bundler it works https://codesandbox.io/s/gallant-pate…ile=/index.html
Posts by alexp
-
-
It seems this error is specific to Codesandbox or Parcel.
For example this works fine locally, but have an error in Codesandbox https://codesandbox.io/s/admiring-daw…ile=/index.html -
-
You need to call the embedpano function after the krpano script is loaded.
As it's done in the krpano default html synchronously or use load event if you load script dynamically. -
Hi, disable xml encryption in your old project if it's enabled.
-
-
Here is an example code
Code<hotspot name="spot1" onover="get_scene_data" onout="set(layer[scene_data_img].visible, false)"
-
Google for Screen Sharing Apps
-
But, how to make a CSS hotspot?
I mean to add styles to a hotspot that is made in KRpano, as in your example.
Hotspots should have property renderer="css3d" and you can get the sprite hotspot[name].sprite - an element that you can style with CSS, add CSS class to it with Javascript element.classList.add("class-name") -
Yes it's absolutely possible with krpano.
However, in this example, this made with CSS transform and transition.
It has a div element with an icon with border-radius: 50%; that makes it round and :hover rule that change it to the bigger size and transition property to animate the size changing. The second div element with the title has a small scale by default to be invisible and on hover the icon element title has transform: scale(1, 1); and transition to smoothly appear on the screen. -
How do I dynamically place the layer to the opposite side if the hotspot's location is too close to the edge?
You can change the layer edge property.
Here is the action example, it works better if your layer aligned to "top"Code
Display More<action name="change_edge" type="Javascript"><![CDATA[ var hotspotName = args[1]; var layerName = args[2]; var offset = parseFloat(args[3]); var l = krpano.layer.getItem(layerName); // save original edge if (!l.origedge) l.origedge = l.edge || l.align; function getEdge (hs, offset) { var edges = krpano.spheretoscreen(krpano.hotspot.getItem(hs).ath, 0); return edges.x < offset ? 'lefttop' : edges.x > (krpano.stagewidth - offset) ? 'righttop' : l.origedge; }; l.edge = getEdge(hotspotName, offset); ]]></action>
and call it on hotspot click
layername - name of the layer child of the hotspot
offsetvalue is a number for example: 50 -
Maybe upgrade krpano to 1.20.8 for panotour will help...
-
hotspot.url = "data:text/plain
Did you try data:text/javascript ?
-
Thanx a lot for the Panotour package update !
When adding a basic hotspot to go to another scene a warning message is displayed in the logs : WARNING: Unknown action: events.dispatch ?I also see warning messages in log of the Panotour project
All events.dispatch produses warnings.
There is an actionIf I call this action in Chrome devtools - no warnings in the krpano log.
Also, there was a warning for jsget....
With the new package for Panotour the html file isn't generated ? (tried on on new built project)
I did with fullpage.html template - works ok
-
Yes you can use a basic action. I just saw in your code krpano.events... which is used in Javascript type actions.
Depends on your project,
dynamically set onnewscene action in eventor set in event directly
The action, which will be executed on new scene
-
-
As stated in the docs, in onready callback you get krpano Javascript-Interface object (where you need to use get, set, call).
Inside the plugin you get The krpano Interface Object - this object provides access to interfacing functions and to the whole krpano data structure. -
DeviceOrientationEvent.requestPermission()
.then(function() {
console.log('DeviceOrientationEvent,DeviceMotionEventenabled');
})It seems permission have to be requested separately for DeviceOrientationEvent and DeviceMotionEvent