How to check map pan?

69 views
Skip to first unread message

Venkat Gowtham Kumar

unread,
Apr 25, 2016, 10:38:14 PM4/25/16
to cesium-dev
Hi,

I need help in checking whether the map is panned or not. Is there any method , property or event in camera API to check this? 

Thanks,
Gowtham.

Hannah Pinkos

unread,
Apr 26, 2016, 10:11:24 AM4/26/16
to cesium-dev, gowtham.m...@gmail.com
Hello Gowtham,

We have events for detecting when the camera moves.  See Camera.moveStart and Camera.moveEnd: http://cesiumjs.org/Cesium/Build/Documentation/Camera.html#moveEnd

Best,

Hannah

Venkat Gowtham Kumar

unread,
Apr 26, 2016, 10:53:28 AM4/26/16
to Hannah Pinkos, cesium-dev
Hi Hannah,

Thanks for the reply. As per my understanding moveStart and moveEnd fires for both map zoom and pan operations.
I need to distinguish between pan and zoom. Could you please help me on this?

Thanks,
Gowtham.

Hannah Pinkos

unread,
Apr 26, 2016, 11:55:27 AM4/26/16
to cesium-dev, pinkos...@gmail.com, gowtham.m...@gmail.com
There isn't anything built into Cesium to handle this, but you might be able to accomplish it by listening to different mouse events.  You can see if it was a left click or a right click, and only do something when a left drag was used.

-Hannah
Reply all
Reply to author
Forward
0 new messages