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

Marc Jansen jansen at terrestris.de
Fri Apr 8 04:27:37 EDT 2011


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




More information about the Dev mailing list