[OpenLayers-Users] using mapserver for wmsgetfeatureinfo

Duncan Sayers duncansayers at threefivesouth.net
Thu Feb 16 05:30:44 EST 2012


Not much detail on what sort of problems you're having, but I've got the
WMSGetFeatureInfo control working for both Geoserver and Mapserver without
too much grief. I think the only drama I had was in paying attention to how
the control works out what layers to send wmsgetfeatureinfo requests for. I
was watching firebug and wasn't seeing any requests getting fired off so I
dug a little deeper. Have a look at the "internal" findLayers method in the
WMSGetFeatureInfo control for details. That was how I got the best idea on
how this behaves. It seems (from my humble understanding) that there are a
couple of things the control needs to work out:

1. The candidate layers to query either come from the "layers" property if
set in the control, or if "layers" is null (the default), get the layers
property from the map.
2. If "queryVisible" is false in the control (the default) then they all
remain candidates. If "queryVisible" is true, then only the visible layers
remain candidates
3. If you have configured the "url" property, ok move on....if not, the url
of the first layer in the above layer candidates array becomes the "url"
property for the control.
4. The url of each of the candidate layers needs to match either
* the "url" property found in 3.
* a url found in the alternatives setup in the "layerUrls" property of the
control (you might use layerUrls if you're tile caching for example).

If the candidate layers have passed these tests, then the control will
shoot off wmsgetfeatureinfo requests for these layers. Firebugs console
will show you if these requests are being sent. Once that bit is working
then all you then need to do is deal with the response. If you just want
example code, use those provided on the openlayers site, and tweak them
until you at least get a response using the above clues - paying attention
to any errors you might get from mapserver when you do (eg. your query
templates aren't setup correctly etc). Mapserver errors are usually quite
useful.

Otherwise, post more detail on what sort of trouble you're experiencing...

On Wed, Feb 15, 2012 at 10:12 PM, Mark Volz <volzmark at yahoo.com> wrote:

> Hello,
>
> I am having trouble getting openlayers to use mapserver for
> wmsgetfeatureinfo.  Does anyone have any examples that I could use?  Most
> of what I came across  thus far is for geoserver, not mapserver.
>
> Thanks
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120216/593e7e5d/attachment.html


More information about the Users mailing list