I have the problem that the WMS layers are hidden from the basemap, I try to solve the problem with the zIndex but it does not work. Any other ideas?

WMS Layer

var two = L.tileLayer.wms('http://localhost:8080/geoserver/Routen/wms', {
        layers: 'Routen:engelbecken',
        type: 'FeatureCollection',
        format: 'image/png',
        zIndex: 1,
        transparent: true


var OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
zIndex: 2,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  • 1
    The stuff on top is the one with higher z-indexes - you should swap those, so that the WMS tilelayer has a higher z-index than the OSM basemap. Otherwise, see leafletjs.com/examples/map-panes – IvanSanchez Feb 25 at 17:30
  • I try it also with a zIndex change but it does not work. I will try it with map-panes. – den98 Feb 25 at 19:06

Your Answer

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

Browse other questions tagged or ask your own question.