[OpenLayers-Users] Looping through the features of a WMS layer

Arnd Wippermann arnd.wippermann at web.de
Fri Aug 20 08:13:13 EDT 2010


Hi,
 
if you use WMS you have no access to any features. You get only a picture.
For a certain point you can request GetFeatureInfo. If you want features,
you have to use WFS.
 
But keep in mind. You get only that from the servers, what they want to
publish (i.e attributes of GetFeatureInfo).
 
Arnd
 
 
  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Frank
Gesendet: Donnerstag, 19. August 2010 02:11
An: users at openlayers.org
Betreff: [OpenLayers-Users] Looping through the features of a WMS layer


Hi,

I want to get the map of Canada then loop through all provinces, in order to
color them differently (I'm going to create a new Vector layer for each
province and apply its own styleMap) :

var wmsLayer = new OpenLayers.Layer.WMS("Canada",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{
   layers: "bathymetry,land_fn,park,drain_fn,drainage," +
   "prov_bound,fedlimit,rail,road,popplace",
   transparent: "true", format: "image/png"
});

So the question is how to loop through the WMS layer features or
"prov_bound" to retrieve each province's geometry. 

Thanks!
Francois




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100820/dae08668/attachment.html


More information about the Users mailing list