Hi.
I use the HTML5 viewer (krpano 1.18.5) and have a context menu option for adding a hotspot.
Code
<contextmenu>
<item name="addHotspotMenuItem" caption="Add hotspot" onclick="js(createHotspot())"/>
</contextmenu>
In my JavaScript file I have a function to handle the hotspot creation.
Code
function createHotspot() {
var krpano = document.getElementById("krpanoViewer");
var mx = krpano.get("mouse.x");
var my = krpano.get("mouse.y");
var pt = krpano.screentosphere(mx, my);
window.external.HotspotCreated(pt.x, pt.y);
}
The problem is that the mouse point is the where the mouse is at the moment that the context menuitem is clicked.
I need to get the point where the right-click was as this should be the hotspot point.
How is this best done?
A related question.
In addition to a using context menu for adding a hotspot it would be a nice feature to use a double-click event for adding the hotspot. Is this possible 'out-of-the-box' or is a plugin necessary for handling double-click events?
Thanks.
Best regards
Dan