Kayle
September 18, 2019, 6:08pm
1
Hi there.
I’m really interested in the source of this:
https://threejs.org/examples/misc_controls_map.html
However I don’t see the source of it or any Map Control in the documentation.
If I don’t find any help here I might have to dig around the html and find the relevant parts, but I really think I’m missing something. If it’s just an orbit control with a minor tweaks, the code would be appreciated too.
Thanks,
Kayle
Mugen87
September 18, 2019, 6:49pm
2
That’s correct. MapControls
is more or less a pre-defined configuration of OrbitControls
.
THREE.MapControls = function ( object, domElement ) {
THREE.OrbitControls.call( this, object, domElement );
this.mouseButtons.LEFT = THREE.MOUSE.PAN;
this.mouseButtons.RIGHT = THREE.MOUSE.ROTATE;
this.touches.ONE = THREE.TOUCH.PAN;
this.touches.TWO = THREE.TOUCH.DOLLY_ROTATE;
};
THREE.MapControls.prototype = Object.create( THREE.EventDispatcher.prototype );
THREE.MapControls.prototype.constructor = THREE.MapControls;
1 Like
Kayle
September 18, 2019, 7:18pm
3
Huh, I knew it.
Turns out the demo code I was using was with three js r77. It didn’t have MapControls back then.
But now I have some migration errors to fix, ugh.
Thanks a lot!
1 Like