Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com 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.

1

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 850

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

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 :: reddit.com/r/VirtualTour

benji33

Fortgeschrittener

Beiträge: 244

Wohnort: France

Beruf: Senior Software engineer

  • Nachricht senden

3

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 (http://krpano.com/docu/actions/#screentosphere) and/or hlookat/vlookat values