[OpenLayers-Users] GetFeature info from a MapServer WMS
yves.moisan at boreal-is.com
Fri Jul 18 16:39:14 EDT 2008
Audience of this message : users of MapServer (WMS).
I'm trying to find examples of how to retrieve attributes from a postgis
table served via MapServer WMS. I have my points in OL, now I want and
"info" on them. I understand I have to enable the layer to be queryable
in my mapfile. So I googled and found a top level directive (QUERY \n
STATUS ON), but that was found to be an offending command. I also found
a bunch of other directives, so my mapfile now looks like this :
# OGC:WMS specific tags
"ows_title" "Resettlement Sites"
"ows_abstract" "RAP Resettlement Sites"
"ows_keywordlist" "Resettlement, TFM"
"ows_extent" "389443 8816705 442791 8858984"
# OGC:WFS specific tags
# specify which fields to include when returning queries
The mapfile top level projection is set to 900913 and that gets
translated fine overtop of a Google base layer.
On the OL side, I found some InfoButton code which I think I have
adapted correctly for my layer. I don't see anything when I click on my
map. I'm obviously missing something and I won't go into the details,
but rather I will just ask for pointers to example MapServer served WMS
layers that are queryable through OL (that is, one clicks and some div
gets populated with attribute content or better some popup appears)
showing all settings. I am a bit flabergasted by the number of moving
Just for the sake of it, I extracted my data and turned it into a
textfile which I then used in OpenLayers.Layer.Text (as per
OOTB, one gets a nice popup, default icon and default html formatting.
I wonder if one could get as easy a popup solution for a WMS served
queryable layer ? I wouldn't be so crazy as to generate a textfile on
the fly to duplicate my layer so that it becomes easily queryable ...
Thanx for pointers,
More information about the Users