Optional
onOptional method called when the layer has been added to the Map with Map#addImage.
The Map this custom layer was just added to.
Optional
onOptional method called when the icon is removed from the map with Map#removeImage. This gives the image a chance to clean up resources and event listeners.
Optional
renderThis method is called once before every frame where the icon will be used.
The method can optionally update the image's data
member with a new image.
If the method updates the image it must return true
to commit the change.
If the method returns false
or nothing the image is assumed to not have changed.
If updates are infrequent it maybe easier to use Map#updateImage to update the image instead of implementing this method.
true
if this method updated the image. false
if the image was not changed.
Interface for dynamically generated style images. This is a specification for implementers to model: it is not an exported method or class.
Images implementing this interface can be redrawn for every frame. They can be used to animate icons and patterns or make them respond to user input. Style images can implement a StyleImageInterface#render method. The method is called every frame and can be used to update the image.
See
Add an animated icon to the map.
Example