You are not logged in.

1

Tuesday, July 30th 2019, 11:25am

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?

2

Tuesday, July 30th 2019, 2:50pm

Hi,

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

e.g.

Source code

1
2
3
4
set(view_changed_by_code, true);
set(view...);
...
onviewchanged="if(!view_changed_by_code, ...); set(view_changed_by_code,false);" 


Best regards,
Klaus

3

Tuesday, July 30th 2019, 4:46pm

Thank you. I'll try.