Your listener id (must be unique for all map events)
The JMap Layer Id
Your listener function
// When mouse is moving on the map over JMap layer id=2, will display messages in the console
JMap.Event.Map.on.mouseMoveOnLayer(
"custom-map-mouse-move-on-layer",
2,
args => {
console.log(
`The mouse is moving on layer id="${args.layerId}"`,
args.map, args.mapEvent // the mapEvent is the Maplibre event
)
console.log(
`The mouse cursor is over ${args.features.length} features`,
args.location
)
}
)
JMap.Event.Map.on.mouseMoveOnLayer
This event is triggered when the mouse is moving over a JMap Layer on the map.
IMPORTANT! : This event currently only works when a JMap layer's "base style" is displayed on the map (non-thematic), and only works well with a base Style Rule with only one condition and one Style Map Scale on JMap Cloud