[OpenLayers-Users] WMS GetFeatureInfo Issue

Guy Griffiths guy.griffiths at reading.ac.uk
Mon Jul 1 04:31:33 PDT 2013


I am having an issue using the WMS GetFeatureInfo control in 
OpenLayers.  I am using OpenLayers for a custom WMS client. Generally 
speaking the GetFeatureInfo functionality works very well.  However, 
when I select a new WMS layer there is a chance that the absolute 
position of the map may move (so that a full title can be displayed 
above the map).  If this happens, subsequent calls to GetFeatureInfo 
give the wrong co-ordinates - shifted by the same amount as the map has 
moved.  It appears as though the GetFeatureInfo control is calculating 
the I and J pixel co-ordinates according to the original (absolute) 
position of the map and is not changing this if the position of the map 
changes.

If anyone could help with how to avoid/work around/fix this problem, I'd 
be most grateful.

Regards,

Guy Griffiths
Reading eScience Centre


More information about the Users mailing list