I'm using rainviewer tiles for the radar data.
https://tilecache.rainviewer.com/v2/radar/1568251200/256/{z}/{x}/{y}/3/0_0.png
And i want update the tiles raster with the timestamp to make animation for a radar, like https://rainviewer.com.
I get the timestamps from this url https://tilecache.rainviewer.com/api/maps.json
I apologize for the bad English
function update_radar(){
$.getJSON("https://tilecache.rainviewer.com/api/maps.json", function(data) {
map.removeLayer("rainviewer");
map.removeSource("rainviewer");
map.addSource("rainviewer", {
type: "raster",
tiles: [
getPath(data[data.length - 1])
],
tileSize: 256
});
map.addLayer({
id: "rainviewer",
type: "raster",
source: "rainviewer",
paint: {
"raster-opacity": 1
},
minzoom: 0,
maxzoom: 12
});
});
}
function getPath(time) {
return "https://tilecache.rainviewer.com/v2/radar/" + time + "/256/{z}/{x}/{y}/3/0_0.png";
}