Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.


Freitag, 6. Februar 2015, 19:45

How to pass in mouse drag event from external javascript call?

Is there a way to pass in a mouse drag event to krpano from an external javascript function? (I know there is no such "drag" event in javascript, but rather a sequence of mouse events that results in a drag).

What I am trying to do is when my external javascript detects a mousedown event on a div in my html, I'd like to "pass" that event into krpano, so that subsequent mouse movement pans the view. So, click on my floating div, and as long as no mouseup event fires, immediately start panning the krpano view with any mouse movement, just like you would if you were to click and drag directly in the krpano tour. On mouseup, stop panning, and "return control" to my html's javascript events.

For illustration purposes, bring up any google street view scene, and hover over an area that results in the cursor changing to an arrow. If you click the mouse then, you go to the linked scene. But, if you click mouse down, and leave it down, you can then pan the view, effectively cancelling the move to the next scene.

This may be more a javascript question than a krpano question, and I'll post elsewhere if it is, but if there is a way to externally hook into the mouse pan "event" in krpano, that would do the trick.

Note: I have tried setting my div's css property "pointer-events" to none once mousedown is triggered, and that works, but only on subsequent mousedown events does the drag event pass through to krpano. I cannot figure out how I can tell krpano that subsequent mouse movements should result in panning of view, when the initial mousedown happened in external element. Maybe this is not even possible, and I'll have to re-evaluate what I'm doing.

Thank you!

Beiträge: 1 848

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden


Dienstag, 10. Februar 2015, 17:10

I don't think that'll be feasible.
Try building your div/html in textfield instead.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter ::



Beiträge: 229

Wohnort: France

Beruf: Senior Software engineer

  • Nachricht senden


Mittwoch, 11. Februar 2015, 10:27

Perhaps compare you drag position into the div size and report these values with javascript interface to the corresponding values with the help of stagewidth, stageheight, vertical and horizontals limits, screentosphere ( and/or hlookat/vlookat values