3

This question already has an answer here:

I need the bounds/full extent of a WMS layer in Leaflet. I don't think L.TileLayer.WMS has a getBounds() method. I had this issue with L.ImageOverlay, and added the functionality via:

L.ImageOverlay.include({
    getBounds: function () {
        return this._bounds;
    }
});

Is there a solution for L.TileLayer.WMS? Or will I have to start parsing the WMS getCapabilities request for its LatLongBoundingBox or BoundingBox elements?

EDIT

I've just found a duplicate: Get bounding box of WMS. This question is still relevant, since Leaflet 1.0 has since been released.

EDIT 2

Get bounding box of WMS does not answer my question - its answer is to parse the getCapabilities response manually. Is there any other way?

marked as duplicate by user30184, Mapperz Jan 30 '17 at 14:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Get bounding box of WMS does not answer my question - its answer is to parse the getCapabilities response manually. Is there any other way?

No.

Leaflet does not parse the WMS capabilities document. To my knowledge, there are no Leaflet plugins to achieve this in an automated way. Using the wms-client NPM package be useful to ease up the parsing.

  • 1
    It seems to me that there is a valid use for this, and not an edge case one. Still, thanks for the authoritative answer. – Tom Chadwin Jan 30 '17 at 13:06

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