skip to Main Content

User Interaction API

map.mouseIsOver: returns true if mouse has entered the Earth’s sphere collider.

map.allowUserRotation/map.allowUserZoom: enables/disables user interaction with the map.

map.rotationAllowedAxis: specifies the allowed rotation axis (both, X or Y).

map.mouseWheelSensibility: multiplying factor for the zoom in/out functionality.

map.invertZoomDirection: switch direction of zoom when using the mouse wheel.

map.showCursor: enables the cursor over the map.

map.cursorFollowMouse: makes the cursor follow the map.

map.cursorLocation: current location of cursor in local coordinates (by default the sphere is size (1,1,1) so x/y/z can be in (-0.5,0.5) interval. Can be set and the cursor will move to that coordinate.

map.constraintPosition, map.constraintAngle, map.constraingPositionEnabled: restricts user rotation so a specified center (contraintPosition) is always less than constraintAngle degrees from the center of the screen.

map.centerOnRightClick: enables auto-centering on country/province under mouse.

map.rightClickRotates: enables globe rotation when holding right mouse button.

map.rightClickRotatingClockwise: changes direction of rotation of globe with holding right mouse button.

map.setSimulatedMouseButtonClick: simulates a mouse click (press + release) (0=left mouse button, 1=right mouse button)

map.setSimulatedMouseButtonPressed: simulates a mouse press (0=left mouse button, 1=right mouse button)

map.setSimulatedMouseButtonRelease: simulates a mouse release (0=left mouse button, 1=right mouse button)

Back To Top