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

Is it possible to hide existing buildings/sidewalks when loading tiles with leaflet?

1

I am building a campus map, and would like to be able to build polygons and paths as layers with leaflet. Is it possible to hide existing sidewalks/buildings in OSM data and replace them with my own?

asked 01 Aug '18, 20:44

ceich11's gravatar image

ceich11
41112
accept rate: 0%


One Answer:

3

Tiles are fixed images. If you do not like what is on them, you have to use another tile server or create your own tiles.

One day in the future, the OSM servers might serve vector tiles that you can render as you wish (was discussed on SOTM the last weekend).

answered 02 Aug '18, 09:46

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

This answer is correct, but there are some ways to work around this. For example, you could try placing another layer on top of the OSM maps. If that layer is opaque on the area of interest, and transparent elsewhere, it will hide the undesired features. It's a crude solution, but perhaps "good enough" for some. :)

(02 Aug '18, 20:38) Tordanik

Source code available on GitHub .