Hi James

On Fri, Jun 6, 2008 at 6:27 PM, James McManus <[EMAIL PROTECTED]> wrote:
> Is there a standard way to enable GetFeatureInfo to only query from the
> current overlay being displayed?  QUERY_LAYERS enables you to query more
> than one layer, but if FEATURE_COUNT is set to 1 then the info from the
> last layer on the list is displayed. You can set FEATURE_COUNT to a
> higher number, but I do not want to do that. Is there a standard way of
> linking LayerSwitcher with GetFeatureInfo?

You can have your "click on map" handler get the list of visible
overlays and use that list in the GetFeatureInfo request, with
something like the following:

var QUERY_LAYERS=[];
for (var i = 0; i < map.layers.length; i++) {
    var layer  = map.layers[i];
    if (!layer.isBaseLayer && layer.getVisibility()) {
        QUERY_LAYERS.push(layer.name);
    }
}

Would that work for you?

Cheers,
--
Eric
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to