• JMap.Event.Map.on.click

    This event is triggered when the mouse is clicked.

    Parameters

    • listenerId: string

      Your listener id (must be unique for all map events)

    • fn: ((params) => void)

      Your listener function

    Returns void

    Example

    // 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
    )
    }
    )