[OpenLayers-Users] Querying multiple layers

Alexandre Dube adube at mapgears.com
Fri Dec 5 08:32:20 EST 2008


ajohnson at ecotropolis.com wrote:
> I have a map with multiple layers (view at
> http://ecotropolis.com/maps/NorthAmericaWatershed.html) and I want to be
> able to click on a feature of any of the maps and retrieve data from the
> WMS (I'm using Geoserver).
>
> I initially got it working using the following line in getFullRequestString:
>
>  QUERY_LAYERS: map.layers[1].params.LAYERS,
>
> This works with one map. I tried extending it to two layers:
>
>
>  QUERY_LAYERS: map.layers[1].params.LAYERS, map.layers[2].params.LAYERS,
>   

Have you tried something like this :

If you use Layer.WMS :

QUERY_LAYERS: map.layers[1].params.LAYERS + "," + map.layers[2].params.LAYERS,


If you use Layer.MapServer:

QUERY_LAYERS: map.layers[1].params.LAYERS + " " + map.layers[2].params.LAYERS,


Alexandre

> but that gave me an error. I got it to run using the following:
>
>   QUERY_LAYERS: wms.params.LAYERS,
>
> Which gives me data, but it is generic for the entire layer to which the
> selected feature belongs instead of specific to a particular element. How
> can I set this up to query multiple layers and return information specific
> to the selected feature?
>
> Regards,
>
> Amy
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list