Ticket #3253 (closed feature: fixed)
Reverse QUERY_LAYERS order in GetFeatureInfo requests
| Reported by: | marcjansen | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.12 Release |
| Component: | Control.WMSGetFeatureInfo | Version: | 2.10 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
See this thread on the developers mailing list: http://osgeo-org.1803224.n2.nabble.com/layer-order-in-findLayers-of-WMSGetFeatureInfo-and-WMTSGetFeatureInfo-controls-td6252895.html
When we issue a GetFeatureInfo request through the OpenLayers.Control.GetFeatureInfo, we merge possible layers to the same service in the order they are returned from the candidates array.
Some WMS servers return the GetFeatureInfo-response ordered in the same way the QUERY_LAYERS were given in the original request.
If we reverse the order in which we merge the layers, the output of a GetFeatureInfo request seems more natural.
You can experience the (slightly unexpected) behaviour in the getfeatureinfo-popup.html example: if you click on a water body, you'll currently end up with the response for the water body layer drawn below the state layer.
The attached patch proposes to inverse the order of layers when we issue the GetFeatureInfo-request.
The inversion of layers is in accordance to the behaviour the WMTSGetFeatureInfo-control shows.
The tests for Control.WMSGetFeatureInfo needed to be adjusted to the new logic to still pass (With this patch applied they pass in FF4).
Thanks for any review or comment.

