[OpenLayers-Dev] layer order in findLayers() of WMSGetFeatureInfo and WMTSGetFeatureInfo controls

Bart van den Eijnden bartvde at osgis.nl
Fri Apr 8 04:30:52 EDT 2011


Hi Marc,

I did not see how the confusing behaviour could be reached, since FEATURE_COUNT is on a *per layer* basis AFAIK.

So if there are features in both layers on the clicked point and FEATURE_COUNT is 1, you will always get back 2 features.

Or am I missing something here?

Best regards,
Bart

-- 
Looking for flexible support on OpenLayers or GeoExt? Please check out http://www.osgis.nl/support.html

Bart van den Eijnden
OSGIS
bartvde at osgis.nl

On Apr 8, 2011, at 10:27 AM, Marc Jansen wrote:

> Hi list,
> 
> I just realized that the findLayers()-method of the controls WMSGetFeatureInfo and WMTSGetFeatureInfo differ in how they iterate over the candidates to use for the final GetFeatureInfo-request: One starts at index 0 and goes up to the length of the candidates array. The other starts with the last candidate and counts down to the first possible layer.
> 
> That basically results in a different order of the layers in the request.
> 
> AFAICT this might lead into confusing behavior, when you only return e.g. 1 result but query two layers. Supposing the place someone clicked is the location of features from both layers, you'd get different results based on the order of layers in the requested URL.
> 
> I'd happily provide a patch that synchronizes the iteration-mechanism to whatever direction is better suited.
> 
> Actually I think we should even have a way of controlling the order of layers in the request. Should we perhaps have a config option for this (maybe something like OpenLayers. Control. LayerSwitcher::ascending)?
> 
> Regards,
> Marc
> 
> 
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
> 



More information about the Dev mailing list