• JMap.Event.Map.on.mouseLeaveOnLayer

    This event is triggered when the mouse leaves a layer feature, and is not over another feature.

    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

    Parameters

    • listenerId: string

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

    • layerId: JId

      The JMap Layer Id

    • fn: ((params) => void)

      Your listener function

    Returns void

    Example

    // When mouse is leaving layer id=2, will display a message in the console
    JMap.Event.Map.on.mouseLeaveOnLayer(
    "custom-map-mouse-leave",
    2,
    args => {
    console.log(
    `The mouse leaved the layer id="${args.layerId}"`, args.location,
    args.map, args.mapEvent // mapEvent is the Maplibre event
    )
    }
    )