This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Having maps without data

0

Using leaflet and OSM, to show some maps on my web application, I need to know if it is possible to have only roads map and remove data from the map which is shown on my page

alt text

 L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '',
    maxZoom: 19
}).addTo(map);

asked 12 Apr '21, 19:57

Ehsan_1362's gravatar image

Ehsan_1362
21224
accept rate: 0%


One Answer:

3

It is possible but you will have to set up your own tile server, and modify the map style to remove those elements you do not want. Setting up your own tile server is described on switch2osm.org.

answered 12 Apr '21, 20:03

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .