• JMap.Event.Map.on.basemapChanged

    This event is triggered when the basemap changed.

    Parameters

    • listenerId: string

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

    • fn: ((params) => void)

      Your listener function

    Returns void

    Example

    // When the basemap is changed, display the new basemap id in the console
    JMap.Event.Map.on.basemapChanged(
    "custom-basemap-changed",
    params => {
    console.log("currentActiveBasemapId:", params.currentActiveBasemapId)
    console.log("newActiveBasemapId:", params.newActiveBasemapId)
    }
    )