File: MapControls.md | Updated: 11/15/2025
This class is intended for transforming a camera over a map from bird's eye perspective. The class shares its implementation with OrbitControls but uses a specific preset for mouse/touch interaction and disables screen space panning by default.
MapControls is an addon, and must be imported explicitly, see Installation#Addons.
import { MapControls } from 'three/addons/controls/MapControls.js';
This object contains references to the mouse actions used by the controls.
controls.mouseButtons = {
LEFT: THREE.MOUSE.PAN,
MIDDLE: THREE.MOUSE.DOLLY,
RIGHT: THREE.MOUSE.ROTATE
}
Overrides: OrbitControls#mouseButtons
Overwritten and set to false to pan orthogonal to world-space direction camera.up.
Default is false.
Overrides: OrbitControls#screenSpacePanning
This object contains references to the touch actions used by the controls.
controls.mouseButtons = {
ONE: THREE.TOUCH.PAN,
TWO: THREE.TOUCH.DOLLY_ROTATE
}
Overrides: OrbitControls#touches