MapControls
class MapControls(component: Component, map: MapLibreMap, var config: MapControls.Config = Config(), observer: MapControls.Observer? = null) : MouseListener, MouseMotionListener, MouseWheelListener, KeyListener(source)
Handles user interactions (mouse and keyboard) for a MapLibre map.
Mouse controls:
Left drag: Pan the map
Mouse wheel: Zoom in/out
Right drag horizontal: Rotate the map
Right drag vertical: Tilt/pitch the map
Ctrl+Left drag: Alternative for rotate/tilt
Double-click: Zoom in at point (animated)
Shift+Double-click: Zoom out at point (animated)
Keyboard controls:
Arrow keys: Pan the map
+/- or =/- keys: Zoom in/out
Constructors
Link copied to clipboard
constructor(component: Component, map: MapLibreMap, config: MapControls.Config = Config(), observer: MapControls.Observer? = null)
Types
Link copied to clipboard
data class Config(val enableDragPan: Boolean = true, val enableScrollZoom: Boolean = true, val enableDoubleClickZoom: Boolean = true, val enableDragRotate: Boolean = true, val enableDragTilt: Boolean = true, val enableKeyboardPan: Boolean = true, val enableKeyboardZoom: Boolean = true, val panSpeed: Double = 1.0, val zoomSpeed: Double = 1.0, val rotateSpeed: Double = 1.0, val tiltSpeed: Double = 1.0)