OnDoubleClick -- MoveTo() -- ScreenToSphere()

  • Hi,

    This thread comes in trying to answer to a post from Richard.

    I would just like it to "move to and center" on double-click - just like Google street view.


    After some search in the forum it seems there is a way to do...
    Look at these post from KLAUS.
    Explanation of jsmouse.swf plugin
    Example to download
    Also, it seems that an ondoubleclick event it is not yet implemented (but planned)... see here for reference: Any way to "double-click" to zoom?

    So, as Klaus explains on the post above, I have used the jsmouse.swf plugin to be able to retrieve the mouse coordinates mouse.x and mouse.y and the screentosphere() function (note: these variables seem to be already implemented in Krpano 1.0.8 beta9 but the screentosphere() function does not... so the jsmouse.swf plugin is needed ) ...
    And I have made a pseudo krpanodbclick() function to simulate an ondoubleclick event ...
    So a code would be:
    xml file: (Edited: I forgot the jsmouse.swf plugin)

    JavaScript to be added inside the html file:

    I have tried this and it works *wink* ...


    SAlut.

    Einmal editiert, zuletzt von michel (26. November 2009 um 12:11)

  • Hi,

    SORRY.... I forgot to put the jsmouse.swf plugin in the xml file example....
    So, the xml would be:

    The jsmouse.swf plugin is needed on krpano 1.0.8 beta 8 and bellow... BUT NOT on krpano 1.0.8 beta 9


    SAlut.

  • Michel,

    This is fantastic work *smile* 'm surprised there is not more reaction to this.

    I will be trying it on my next panorama next week. I notice that the beta8 version seems a bit smoother, perhaps because of the extra mouse plugin ?

    Thanks for looking into this, I know many people have talked about it.

    ps: Is that the view from your house ? very nice *g*

  • Hi Michel,

    great work!
    right, in 1.0.8 beta 9, there the "mouse.x" and "mouse.y" is already implemented,
    so no need for an plugin there,

    ps: Is that the view from your house ? very nice *g*

    that's an holiday apartment in Croatia where I was making holidays some years ago
    see here for "Balkon Apartment Rabac / Kroatien":
    https://krpano.com/examples/multires/

    best regards,
    Klaus

  • I have an addition to the script provided in this thread, which is more production ready:

    An action is defined as such:

    Code
    <action name="_onmousedown">
        js(Pano.registerClick());
    
    
        <!-- Do more magic -->
      </action>

    And defined in javascript:

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!