GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Mutates the live raster source's tile URLs instead of destroying and rebuilding it.

      Only when the two basemaps differ by their tiles alone (_canSwitchByTiles): any other change is baked into the source at creation and would be silently kept. Returns false whenever the mutation cannot be trusted, so the caller falls back to the remove + re-add path — which stays the general case, not a degraded one.

      Parameters

      • map: SourceReaderLike

        Anything exposing getSource; the live raster source is read off it.

      • previous: BasemapDefinition | null | undefined

        The basemap currently applied, or null/undefined at boot — in which case there is nothing to mutate and the call returns false.

      • next: BasemapDefinition

        The basemap being switched to; its tiles are the ones written.

      • onWarn: (message: string, error: unknown) => void

        Reports a failed mutation; the caller then rebuilds.

      Returns boolean

      true when the tiles were mutated in place.