On 8/15/2011 5:53 AM, Andreas Hocevar wrote:
For WMS, all you get is the layer extent advertised in the
GetCapabilities document. This is what is explained in the
> 2nd post you linked.

Yep, Andreas is entirely right. That's how I'd do it.

Use OpenLayers' Request.GET to download the WMS server's capabilities document. Then use Format.XML to parse the XML and get the extent of the layer.

For convenience, you could store these as new attributes within the Layer.WMS instance:
    trafficlayer.wmsbbox = new OpenLayers.Bounds(1,2,3,4)

And call them up similarly:
    <checkbox onClick="map.zoomToExtent(trafficlayer.wmsbbox)" />

--
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: [email protected]
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to