Is it possible to assign DOM attributes to KRPANO layers?

  • What I'm trying to accomplish?
    I'm working on a plugin that needs to know if a mouse click is occurring over a particular layer in KRPANO.

    Why?
    The plugin collects certain information about what the user is doing and if the user is interacting with the pano itself, I am storing cursor position in "screentosphere" coordinates but if a user is interacting with a menu, I need to use "screentolayer" coordinates instead. I'm not sure what is the best way for the javascript plugin to be "aware" of the cursor location in KRPANO other than what I was attempting below.

    I've tried querying mouse clicks with event.target.id and event.target.tagName and I can see the ids and element types of any elements I am adding to the DOM through the plugin but any click outside of specific plugin element just returns an empty id and a DIV for the tageName.

  • It occurred to me I may be able to toggle a variable with the onover, onout, onhover, etc. of a layer in KRPano and the plugin could then query the state of those KRPANO variables through the plugin to know if the cursor is interacting with one of them or not. It feels a little hacky but I'm going to explore tomorrow and thought I'd add it to the "conversation" in case it triggers a better idea or a better approach.

    Einmal editiert, zuletzt von bhh (6. September 2017 um 22:45)

Jetzt mitmachen!

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