How display WMS from Mapserver in leaflet

1284
1
10-15-2022 12:16 PM
JiříKomínek
New Contributor III

Hello, I would like to display a basic map of Brno in wms format in the leaflet. I'm trying to follow the documentation, but I have a problem about any display of data from this layer.

https://gis.brno.cz/arcgis/rest/services/PUBLIC/basemap_brno_zakladni_mapa_seda_tiled/MapServer 

 

 

 

 const map = L.map('map').setView([49, 16.5], 10);

      var wmsLayer = L.tileLayer.wms('https://gis.brno.cz/arcgis/services/PUBLIC/basemap_brno_zakladni_mapa_seda_tiled/MapServer/WMSServer?', {
        layers: "0",
        format: 'image/png32',
      }).addTo(map);

 

 

 

 

 

 

 

Tags (3)
0 Kudos
1 Reply
GavinRehkemper
Esri Contributor

Hi, thank you for the question.

Did you know you can use Esri Leaflet to add this layer to your Leaflet map directly. Use L.esri.DynamicMapLayer. Example here: https://jsbin.com/femehah/3/edit?html,output

L.esri.dynamicMapLayer({
  url: 'https://gis.brno.cz/arcgis/rest/services/PUBLIC/basemap_brno_zakladni_mapa_seda_tiled/MapServer'
})
.addTo(map);

 

I hope this helps!

0 Kudos