vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
1.96k stars 293 forks source link

Set auto animation and disable zoom #34

Open BenPav opened 3 years ago

BenPav commented 3 years ago

Is there a way to disable zooming? I see something about three.js controls, and I've tried that but it does nothing and the mousewheel still zooms. Also, is there a way to set an animation where the globe spins slowly on it's own? Thanks!

vasturiano commented 3 years ago

@BenPav you can do it all with the Threejs controls.

Calling .controls() will give you access to the three orbit controls.

From there you can disable the interaction by setting enabled = false. And set auto rotation with autoRotate = true.

Cloudmersive commented 2 years ago

How do you disable zoom but not pan?

vasturiano commented 2 years ago

@Cloudmersive https://threejs.org/docs/#examples/en/controls/OrbitControls.enableZoom

mmyyaghoubi commented 2 years ago

@vasturiano how user can scroll the page on mobile with touching globe when enablePan & enableRotate are true? my problem is that user can not scroll my page when touch the globe.(can only rotate or zoom)

vasturiano commented 2 years ago

@mmyyaghoubi you can either leave some horizontal space on the side of the globe for the user to scroll down the page, or you can disable rotation interactions on the globe.