Anything exposing getSource; the live raster source is read off it.
The basemap currently applied, or null/undefined at boot — in which case
there is nothing to mutate and the call returns false.
The basemap being switched to; its tiles are the ones written.
Reports a failed mutation; the caller then rebuilds.
true when the tiles were mutated in place.
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
falsewhenever 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.