onviewchanged event

  • Hi. When I change the view with the mouse, the onviewchanged event called. And when I change the view with code:

    this.krpano.set('view.hlookat', hlookat);
    this.krpano.set('view.vlookat', vlookat);
    this.krpano.set('view.fov', fov);

    The onviewchanged event also called.
    Is it possible to disable the event when the view changed through the code. Or how can I tell them apart?

  • Hi,

    you could set a flag before changing the view and check for that flag in the onviewchanged event...

    e.g.

    Code
    set(view_changed_by_code, true);
    set(view...);
    ...
    onviewchanged="if(!view_changed_by_code, ...); set(view_changed_by_code,false);"

    Best regards,
    Klaus

Jetzt mitmachen!

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