I've created a leaflet map and use L.tileLayer.wms to load my wms layer. I dont want to load all data on my map instead i need to load data based on bbox.I use this line for sending wms request to geoserver :

  .wms(elm.GIS_LayersAddressMapServer.trim(), {
    layers: elm.GIS_LayersName,
    format: "image/png",
    transparent: true,
    tiled: true,
    maxZoom: 25,
    bbox: map.getBounds().toBBoxString(),

but in network console i have this :


as you see bbox is sent twice and doesn't show me anything. How can i handle this problem ?

  • 2
    L.tileLayer.wms creates it's own bbox parameter when creating wms request, so specifying additional one won't help. Instead try with Leaflet's bounds option. – TomazicM May 19 at 6:56
  • TomazicM - what do you mean by bounds ?. you mean i ought to create wms request and pass bounds to it ? could you please send me a sample . – hamed May 19 at 7:01
  • 1
    L.tileLayer.wms layer inherits bounds option of general L.GridLayer layer, see leafletjs.com/reference-1.6.0.html#gridlayer – TomazicM May 19 at 7:43
  • TomazicM - tnx alot. but i still can't find any proper method to handle my problem ! – hamed May 20 at 7:28
  • 1
    Edit your question and describe what have you tried and still does not work as expected. – TomazicM May 20 at 7:52

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.