Thanks for the suggestions (and sorry for the late reply).
As Tuur suggested I'm using a key event for this. Pressing the 'h' or 'H' key will create a hotspot.
I'm also using a double-click event (2 click events within a certain time).
Code
<events name="addHotspotEvent"
onclick="js(panoramaClicked())"
onkeyup="js(panoramaKeyed())" />
Code
function panoramaKeyed(args) {
var krpano = document.getElementById("krpanoViewer");
if (window.canAddHotspot) {
var keyCode = krpano.get("keycode");
if (keyCode === 72 || keyCode === 104) {
createHotspot();
}
}
}
Alles anzeigen
Code
function panoramaClicked(args) {
if (window.canAddHotspot) {
window.clickCount++;
if (window.clickCount == 1) {
setTimeout(function () {
if (window.clickCount > 1) {
createHotspot();
}
window.clickCount = 0;
}, 300);
}
}
}
Alles anzeigen
Excellent news about the new variables , I will be looking forward to it.
Best regards
Dan