mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

[Feature request] RasterTileSource.setTiles

Open fungiboletus opened this issue 2 years ago • 3 comments

Motivation

I have a RasterTileSource with a WMS layer of satellite pictures (sentinel 2). I would like to be able to changes the tiles on the fly, to change some parameters of the WMS server, such as the date range of the pictures or the colour mapping.

Design Alternatives

I would like something like VectorTileSource.setTiles, but for RasterTileSource.

In my current implementation, I delete the layer and create a new one instead of updating the tiles. It works fine but it's not perfect. Especially the whole layer disappear before the new layer is loading. I would prefer to have the tiles replaced as they load. I could also keep the old raster layer below the new one while the new one loading, but at some point it may be better to implement the setTiles feature.

Related issue: https://github.com/visgl/react-map-gl/issues/1876#issuecomment-1151727140

fungiboletus avatar Jun 10 '22 07:06 fungiboletus

I'm not sure what the level of effort would be, but from a feature standpoint, this would be very useful. The raster urls we use have query strings for selecting things like bands, color scales, and many other parameters. It would be nice to be able to change those parameters on a source without going through the potentially error-prone process of recreating the source to display the same tileset.

shermify avatar Jun 10 '22 20:06 shermify

I could really use this too.

Ideally HTTP, HTML, GeoJSON and Vector Tiles/PBF would be separated from the core altogether; they don't belong in application logic and are a pain to work around in a data-driven PWA with client-side editing.

fr-an-k avatar Jun 22 '22 18:06 fr-an-k

We have the troubles with the same functionality: be able to changes the tiles on the fly

roman-hatz-srf avatar Sep 19 '22 14:09 roman-hatz-srf