How to create a map that shows only city names and does not show any label or landmarks like hotel, hospital, etc. using OSM and leaflet

I’m new to OSM and want to create a leaflet map using OSM that shows only city names and does not show any label or landmark like hospital, hotel, etc. Kindly help me create this map.

Here’s the sample code:
// Create a Leaflet map centered at a specific location and zoom level
const map = L.map(“leaflet-map-popup”).setView([20.5937, 78.9629], 5);

  // Customize the map's appearance with a custom tile layer (HOT style)
  L.tileLayer("https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png", {
    maxZoom: 16,
    tileSize: 512,
    zoomOffset: -1,
  }).addTo(map);

Thanks in advance

Hi and welcome to OSM
Your code snipped will load pre generated map-tiles from openstreetmap.fr . So you have to take what is included in this map.
You can set up your own tile server where you can define which features will be shown on your map.
You can search for other map providers which may have map-tiles that meets your requirements.

Leaflet is a map library that allows all sorts of different content to be shown. The example you’ve shown allows raster map tiles to be shown, but that’s not your only option.

Assuming that raster tiles is the way you want to go, you have a couple of options. One is to find a provider with the sort of tiles that you are looking for, and another is to create them yourself.

The OSM wiki lists various tile providers, and the switch2osm.org site has some too. If that doesn’t work out, you can follow one of the “serving tiles” pages at switch2osm.org to set up something that can serve raster tiles like OSM.org.

Next, you’ll want a map style that only shows the information that you want. It might be worth looking at Natural Earth data for that - they have various datasets that do that sort of thing. Another option is to comment out parts of the map style (in the “project” file) that you’re not interested in.

Which of these many possible approaches is best for you depends very much on what you are familiar with, how big an area you want to create a map for, among other things.

1 Like