Scott Stewart wrote:
> Hi,
> 
> Using Openlayers with Mapserver (backended by a POSTGIS db), is there any
> known or prescribed way to get a list of layers that would be displayed in
> the viewport?
> 

A WMS GetCapabilities request will return a document listing all 
available layers if you've configured your mapfile for WMS.

With a typical GetCapabilites request, you can't ask the server to limit 
what it responds with (only layers in a provided bounding box).  The 
client is forced to deal with the full capabilities doc, but you can do 
the filtering after parsing.

The OpenLayers.Format.WMSCapabilities parser can be of use in parsing 
capabilities docs.

> If it matters, we do store the extent of each layer in the mapserver map
> config file.
> 
> The end game is to be able to build a legend for layers that are on the map.
> Any ideas?
> 

A WMS GetLegendGraphic request will return a server generated legend.

Tim

> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Dev mailing list
> Dev@openlayers.org
> http://openlayers.org/mailman/listinfo/dev


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.
_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev

Reply via email to