Class AnimatedRouteLayerMaptiler
Implements
Index
Constructors
Properties
Methods
Constructors
Maptilerconstructor
Parameters
- __namedParameters: AnimatedRouteLayerOptions
Returns AnimatedRouteLayer
Properties
MaptileranimationInstance
The MaptilerAnimation instance that handles the animation
Readonly Maptilerid
Unique ID for the layer
Readonly Maptilertype
The layer's type. Must be "custom".
Methods
MaptileraddEventListener
Adds an event listener to the animation instance.
Parameters
- type: AnimationEventTypes
The type of event to listen for
- callback: FrameCallback
The callback function to execute when the event occurs
Returns AnimatedRouteLayer
- type: AnimationEventTypes
MaptilerframeAdvance
This method is used to manually advance the animation
Returns AnimatedRouteLayer
- The current instance of AnimatedRouteLayer
MaptilergetMaptilerAnimationOptions
Gets the source GeoJSON data from the map instance, parses it, and returns the animation options.
Returns Promise<MaptilerAnimationOptions & { autoplay: boolean }>
- The MaptilerAnimation constructor options
MaptileronAdd
This method is called when the layer is added to the map. It initializes the animation instance and sets up event listeners.
Parameters
- map: Map
The map instance (maplibre Map, but will be MapSDK at runtime)
Returns Promise<void>
- map: Map
MaptileronRemove
This method is called when the layer is removed from the map. It destroys the animation instance.
Returns void
Maptilerpause
Maptilerplay
MaptilerremoveEventListener
Removes an event listener from the animation instance.
Parameters
- type: AnimationEventTypes
The type of event to remove
- callback: FrameCallback
The callback function to remove
Returns AnimatedRouteLayer
- type: AnimationEventTypes
Maptilerrender
This method is called to render the layer. It is a no-op for this layer.
Returns void
MaptilerupdateManual
Returns void
Creates an animated route layer for MapTiler maps.
The
AnimatedRouteLayerallows you to animate paths on a map with visual effects and optional camera following. You can define animations either through explicit keyframes or by referencing GeoJSON data with animation metadata.Features:
Example
Implements