1

I am using one plugin with my leaflet map.

<script>
var map = L.map('mapid').setView([-21.12, 55.5], 16 );
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { }).addTo(map);
L.marker([-21.12, 55.5]).addTo(map).bindPopup('Help ME!').openPopup();
</script>

I want to change the fonts in the map (Leaflet). I put the font code:

body{font-family:arial,tahoma !important"}

In the CSS file, but the font doesn't change on the map (Leaflet).

My problem is that the font does not change in the text.

enter image description here

ghybs
  • 47,565
  • 6
  • 74
  • 99
behroz
  • 84
  • 7

1 Answers1

1

What you show in your screenshot are raster tiles, i.e. plain images from the tile server you specify in the tile layer template URL.

You will not be able to change the text in those images with client side CSS.

But you can change the tile server you point to, if you can find one that serves tiles that meet your desired style. Or you can serve your own tiles, or use a tile provider that offers customization feature.

See R leaflet Language of the map : Can we specify to use English language

ghybs
  • 47,565
  • 6
  • 74
  • 99