Map
Map fork from maplibre-gl-js@4.3.2, keep event loop, responds user interaction and updates the internal state of the map (current viewport, camera angle, etc.)
sequenceDiagram
actor user
participant DOM
participant handler_manager
participant handler
participant camera
participant transform
participant map
user->>camera: map#setCenter, map#panTo
camera->>transform: update
camera->>map: fire move event
map->>map: _render()
user->>DOM: resize, pan,<br>click, scroll,<br>...
DOM->>handler_manager: DOM events
handler_manager->>handler: forward event
handler-->>handler_manager: HandlerResult
handler_manager->>transform: update
handler_manager->>map: fire move event
map->>map: _render()
- Transform holds the current viewport details (pitch, zoom, bearing, bounds, etc.). Two places in the code update transform directly:
- Both camera and handler_manager are responsible for firing
move
, zoom
, movestart
, moveend
, ... events on the map after they update transform. Each of these events (along with style changes and data load events) triggers a call to Map#_render() which renders a single frame of the map.