Situation
We render a raster layer to the map. The layer\'s source has an initial tile-url. Now we want to change the tile-url of the source an
It sounds like you're trying to change the URL of a raster
source. The proper way to do this in GL JS is to remove the source and then add a new source with the same id and the new url.
map.addSource('tile-source', {...});
map.addLayer('tile-layer', {source: 'tile-source', ...});
// react to a button click or what ever to trigger tile url change
...
map.removeSource('tile-source');
map.addSource('tile-source', {tiles: ['new-tile-url'], ...});