Reputation: 802
I came across planetary.js--for rotating a globe--after it supported mobile devices.
I would like to know if the drag plugin can restrict the movement only to the x-axis and rotate the globe to a certain level.
Say, for example, I have 3 latlng places; initially the globe rotates and, on drag/swipe left, the globe rotates but it is restricted in rotation to the first latlng place. On successive drags the rotation is permanently paused and the rotation happens till the next latlng, and so forth.
Upvotes: 1
Views: 169
Reputation: 159125
The built-in drag plugin doesn't support this kind of behavior, but Planetary.js was built so that custom behavior can be easily added. Check out the source for the built-in drag plugin; it's only about 35 lines of code, and shows the basic operations you can use to update the globe's rotation.
Upvotes: 1