[OpenLayers-Users] Click event for multiple GML layers (Getting
only topmost layer click event)
Andreas Hocevar
ahocevar at opengeo.org
Tue Jul 7 04:34:11 EDT 2009
Hi,
Sajeer... wrote:
> I have 2 wms and 4 GML(kml) layers in my mp,and layer switcher for
> this GML layers is very much needed in this application so i created 4
> separate layers for GML files.
> These things are working fine ,but when i am trying to add click event
> to get feature information for all these GML layers it showing feature
> information only for the topmost layer.
If you want feature information from vector layers, use the
SelectFeature control and configure it with an array of layers.
If you want to display WMS GetFeatureInfo responses, either use the
WMSGetFeatureInfo control.
If you really want to work with a bare browser click event handler, like
in the getfeatureinfo.html exmaple, you just need to add all the layers
you want to query to the LAYERS param of the request, or, if the layers
come from different WMS servers, issue one request for each server.
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list