3

I am loading OpenStreetMap using Leaflet.

More or less I'm doing this:

var objmap = new L.Map(p_objCapaMapa, mapOptions);
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
capaMapa= new L.TileLayer(osmUrl);
objmap.addLayer(capaMapa);

Very easy and it works. But the map is loading a lot of Points of Interest like restaurants, shops, etc A lot of little icons over the tiles of the map.

How can I avoid the map load all these points?

I need Leaflet to just load the map with its roads, squares, streets, parks, etc.

In JavaScript Google Maps API there is a way of not loading these POIs that comes with the map but I do not know a way to avoid POIs over OpenStreetMap using Leaflet.

We have searched a lot for the web but we still do not have a solution to this.

7

Simple answer: You can not.

Unlike Google maps API, these icons are part of the pre-rendered tiles you get from openstreetmap.org, and there is nothing you can do about it.

You may however look for other tile sorces based on Openstreetmap data, like Stamen .

Or render your own tiles with tools like Maperitive. Then you are free to leave out any data you don't want to see in your own map.

  • Thank you very much for your help. It save me a lot of time. – Falinsito Aug 26 '18 at 19:21
  • @Falinsito, you can show your appreciation by both upvoting and accepting the answer. You can visit the tour for more information. – Fezter Aug 26 '18 at 22:44
  • 3
    See also wiki.openstreetmap.org/wiki/Tile_servers - in particular the "no labels" tiles. – IvanSanchez Aug 27 '18 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.