1

There is a working example in leaflet site for adding WMS Layer in leaflet map at : http://leafletjs.com/reference.html#tilelayer-wms. But I don't see methods to provide the filter for bounding box.

Is there a way to provide bounding box filters for Leaflet WMS ?

2

Leaflet does this on the fly depending on your location of viewport, viewport size, zoom and projection. It takes care of the math and which tiles to request. If you are interested in where this is done you can take a look at the source code for WMS Tile Layer. The bounding box isn't really defined until line 50.

If you need to create a custom bounding box it is just a matter of editing the source so L.TileLayer.WMS takes some new variables and replacing it with your own input.

**Note my link is at the current head of the git (28 May 2013), this could change.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.