The Interactions module allows you to be notified when the user interacts with the map.
Interactions include clicking and hovering on points and features.
The Interactions controller allows you to observe interactions with the map
onPointerClick(
params
: {handler
: (event
:MapInteractionEvent
) =>void
; }):VoidFunction
Allows you to be notified the user clicks on the map.
Parameters
params
object
params.handler
Returns
VoidFunction
A function to unsubscribe from the listener
Example
onPointerMove(
params
: {handler
: (event
:MapInteractionEvent
) =>void
; }):VoidFunction
Allows you to be notified the user moves the mouse over the map.
Parameters
params
object
Params for the listener
params.handler
The handler function
Returns
VoidFunction
A function to unsubscribe from the listener
Example
(event
: ) => void
(event
: ) => void
The event object passed to the interaction listeners.
coordinate:
LatLng
The cursor position in world coordinates.
features:
Feature
[]
The vector features that are under the cursor.
rasterValues:
RasterValue
[]
The raster pixel values that are under the cursor.