Open ViniciusFariasS opened 7 months ago
Hi @ViniciusFariasS,
You can try updating the source tiles URL with setTiles
, however this might cause flickering https://docs.mapbox.com/mapbox-gl-js/api/sources/#rastertilesource#settiles
map.getSource('id').setTiles(['https://another_end_point.net/{z}/{x}/{y}.png']);
How to make a time series animation with Source and Layer using the endpoint 'myendoint.com/weather/maps/${type}/${date}/tiles/{z}/{x}/{y}' where the date is dynamic to take 6 hours ahead of the current time, saving the previous images in cache so as to avoid unnecessary requests and the animation runs cleanly.
<Source id={'satellite'} type="raster" tiles={['myendoint.com/weather/maps/${type}/${date}/tiles/{z}/{x}/{y}']} tileSize={512} scheme='xyz' minzoom={5} maxzoom={12}> <Layer {...{ id: 'satellite-layer', type: 'raster', preload: 'infinity', source: 'satellite', paint: { 'raster-opacity': 0.8, 'raster-fade-duration': 650, } }} /> </Source >