Your listener id (must be unique for all map events)
Your listener function
// When mouse clicked on the map, will display a message in the console
JMap.Event.Map.on.click(
"custom-map-mouse-click",
args => {
const location = args.location
console.log(
`The mouse has been clicked at { x="${location.x}, y="${location.y}" }"`,
args.map, args.mapEvent // mapEvent is the Maplibre event
)
}
)
JMap.Event.Map.on.click
This event is triggered when the mouse is clicked.