Flyer + local .osm file

I used leaflet.js to render the maps as shown in the launch sheet page :

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { ...

      

I downloaded the .osm file (map.osm) from openstreetmap and I am triying to figure out how I can use this file from the flyer like:

L.tileLayer('file:///./map.osm/{z}/{x}/{y}.png/{z}/{x}/{y}.png', { ...

      

On other occasions, I have used Mobile Atlas to load a map layer and use it in a flyer. It loads the selected maps into a directory structure like files with zoom - x - y.png (ex: file_system \ local_maps_dir \ 13 \ 4049 \ 2999.png where 13 is zoom latitude 4049 and longitude 2999).

But now I need to download or use these .osm files with a flyer.

Is there a way to do this? Do I need to convert this .osm file?

Thanks everyone for your time.

+3


source to share


1 answer


You can not. A flyer requires a tiles raster , whereas an .osm (or .pbf) file contains raw vector data. To get bitmap slices from vector data, you have to render it. This cannot be done with Leaflet directly, but requires external tools instead.



Rendering tiles locally can be done with, for example, Maperitive or TileMill . You may need one more step to extract individual chunks from the generated MBTiles .

+2


source







All Articles