I am trying to get a WMSGetFeatureInfo
request to work on my MapServer WMS layer but I am not sure how to correctly configure my map file and the request in OpenLayers.
I have setup a jsFiddle with my WMS overlay and the WMSGetFeatureInfo request.
http://jsfiddle.net/goldrydigital/YBWRz/
The request is as follows:
var getFeatureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://137.117.37.130:8081/cgi-bin/mapserv.exe?map=c:/ms4w/wms_sample.map&',
title: 'Identify features by clicking',
layers: 'estados'
})
getFeatureInfo.events.register('getfeatureinfo', map, function (e) {
alert(e.text);
});
map.addControl(getFeatureInfo);
getFeatureInfo.activate();
The layer takes the data from a Mapinfo tab file. The Layer definition in the Map file is as follows:
LAYER
NAME "estados"
TYPE POLYGON
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "estados.tab"
TEMPLATE "blank.html"
DUMP TRUE
CLASS
OUTLINECOLOR 10 10 10
END
METADATA
"wms_title" "estados"
"gml_geometries" "geom"
"gml_geom_type" "polygon"
"gml_include_items" "all"
"wms_include_items" "all"
"wms_feature_info_mime_type" "text/plain"
END
END
Can you put me in the right direction with this?