For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Class MaptilerCustomControlMaptiler
Hierarchy (View Summary)
- MaptilerCustomControl
Implements
Constructors
Maptilerconstructor
-
new MaptilerCustomControl(
selectorOrElement: string | HTMLElement,
onClick?: MaptilerCustomControlCallback<Event>,
onRender?: MaptilerCustomControlCallback<MapLibreEvent>,
): MaptilerCustomControlParameters
- selectorOrElement: string | HTMLElement
Element to be used as control, specified as either reference to element itself or a CSS selector to find the element in DOM
OptionalonClick: MaptilerCustomControlCallback<Event>Function called when the element is clicked
OptionalonRender: MaptilerCustomControlCallback<MapLibreEvent>Function called every time the underlying map renders a new state
Returns MaptilerCustomControl
- selectorOrElement: string | HTMLElement
Methods
MaptileronAdd
-
Register a control on the map and give it a chance to register event listeners and resources. This method is called by Map.addControl internally.
Parameters
- map: Map
the Map this control will be added to
Returns HTMLElement
The control's container element. This should be created by the control and returned by onAdd without being attached to the DOM: the map will insert the control's element into the DOM as necessary.
- map: Map
MaptileronRemove
-
Unregister a control on the map and give it a chance to detach event listeners and resources. This method is called by Map.removeControl internally.
Returns void
The MaptilerCustomControl allows any existing element to become a map control.