1
votes

I want to create an offline map. I create map that baselayer is openstreetmap for small city (download all tiles and save in folders and it works).

L.tileLayer('file://Drivef /.../{z}/{x}/{y}.png'}).addTo(map);
I want to put a wmslayer on it But wmslayer have no latitude to download them like osm tile. i have URL tile of them but that are like TileBounds .

In this link you can see openstreetmap that base layer is openstreetmap that crate with tile layer but overlayer is WMS Tile

this Url Download is for openstreetmap : https://stamen-tiles-c.a.ssl.fastly.net/toner-lite/5/6/11.png that I know zoom=11 ,x=5,y=6.

this url is for WMS tile: https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Observations/radar_base_reflectivity/MapServer/export?transparent=true&format=png32&bbox=-12523442.714243278%2C5009377.085697311%2C-11271098.442818949%2C6261721.357121639&bboxSR=3857&imageSR=3857&size=256%2C256&layers=show%3A3&f=image that I do not know how save it for offline use because i no have x,y,z .

i find this: https://github.com/Luqqk/wms-tiles-downloader but i do not know how use this.

1

1 Answers

1
votes

I find the answer. I use mercantile library python and mercantile.xy_bounds(x_tile_number, y_tile_number, zoom) convert to bbox and download tile save in folder with name that is number x tile and file name is Y tile number.jpg

zoom 1:
-------1:
-----------1.jpg
-----------2.jpg
----------- ...
------- 2:
-----------1.jpg
-----------2.jpg
-----------3.jpg

zoom 2:
-------1:
-----------1.jpg
-----------2.jpg
----------- ...
------- 2:
-----------1.jpg
-----------2.jpg
-----------3.jpg

.
.
.