<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>GetFeatureInfo requests against Mapserver will not be much different than against ArcGIS WMS. Here is an example:</DIV>
<DIV> </DIV>
<DIV><A href="http://mapsvr/cgi-bin/mapserv.exe?map=mylocation&service=wms&version=1.1.1&request=GetFeatureInfo&LAYERS=synlait&QUERY_LAYERS=synlait&INFO_FORMAT=text/plain&SRS=EPSG:2193&BBOX=1492834.61,5131445.29,1493034.61,5131645.29&WIDTH=100&HEIGHT=100&x=50&y=50">http://mapsvr/cgi-bin/mapserv.exe?map=mylocation&service=wms&version=1.1.1&request=GetFeatureInfo&LAYERS=synlait&QUERY_LAYERS=synlait&INFO_FORMAT=text/plain&SRS=EPSG:2193&BBOX=1492834.61,5131445.29,1493034.61,5131645.29&WIDTH=100&HEIGHT=100&x=50&y=50</A><BR><BR>For a single point, just play around with the size of the BBOX, WIDTH, HEIGHT,x & y parameters - make as small or large as you need to ensure you get a single point. You can also specify a TOLERANCE in your mapfile:</DIV>
<DIV> </DIV>
<DIV>LAYER<BR> NAME "synlait"<BR> GROUP "FMS"<BR> DATA ../data/nztm/synlait<BR> SIZEUNITS PIXELS<BR> STATUS ON<BR> DUMP TRUE<BR> # query templates for HTML-based queries<BR> # responds to OGC:WMS request=GetFeatureInfo......&info_format=text/html<BR> HEADER ../templates/synlait_query_header.html<BR> TEMPLATE ../templates/synlait_query_body.html<BR> <BR> # fuzziness for querying<BR> TOLERANCE 5000<BR> TOLERANCEUNITS METERS<BR> TYPE POINT<BR> UNITS METERS<BR> # scale range<BR> MAXSCALE 250000<BR> MINSCALE 750<BR> LABELMAXSCALE 100000<BR> LABELMINSCALE 1<BR> LABELCACHE on<BR> LABELITEM 'reference_code'<BR> CLASS<BR> STYLE<BR> COLOR 138 43 226<BR> OUTLINECOLOR 0 0 0<BR> SIZE 13<BR> SYMBOL "triangle"<BR> END<BR> LABEL<BR> TYPE truetype<BR> FONT "arial"<BR> SIZE 10<BR> POSITION ur<BR> OUTLINECOLOR 235 235 235 #--Halo<BR> COLOR 0 0 0 <BR> BUFFER 2<BR> END #LABEL<BR> END #CLASS<BR> <BR> METADATA<BR> "wms_group_title" "FMS"<BR> "wms_name" "synlait" <BR> "wms_title" "synlait"<BR> "wms_abstract" "These are Synlait farms in NZTM"<BR> "wms_keywordlist" "AgriBase"<BR> #"wms_server_version" "1.1.1"<BR> "wms_srs" "EPSG:2193"<BR> "wms_extent" "1114412.940 4793178.168 2089186.204 6190213.601"<BR> "wms_dataurl_format" "text/HTML"<BR> "gml_include_items" "all"<BR> "gml_exclude_items" ""<BR> "ows_include_items" "all"<BR> "ows_exclude_items" "" <BR> "wms_exceptions_format" "application/vnd.ogc.se_xml"<BR> END<BR> END #synlait</DIV>
<DIV> </DIV>
<DIV>Note: The DATA directive contains the path and name of the Shape file.</DIV>
<DIV>The HEADER and TEMPLATE directives reference a couple of html files that format the response to the GetFeatureInfo request when you request &info_format=text/html. If you are just requesting text/plain then you will get all of the attributes.</DIV>
<DIV> </DIV>
<DIV>regards,</DIV>
<DIV> </DIV>
<DIV>Robert</DIV>
<DIV><BR>>>> sunny74 <sb.ray@hotmail.com> 22/03/2010 6:28 p.m. >>><BR><BR><BR>Hi Robert,<BR><BR>Thanks for your reply.<BR><BR>There are a few doubts about the code:<BR><BR>1) If you taken a single lonlat and then made a bounding box(BBOX) by doing<BR>+- 10.<BR>But what if I want to get the feature info of just one point.What will be<BR>the url in that case?<BR><BR>2) The url is "var regc =<BR>"http://ws-esrimt/arcgis/services/mapservice_asurequality_prod/MapServer/WMSServer?service=WMS&version=1.1.1&request=GetFeatureInfo&QUERY_LAYERS=2&INFO_FORMAT=text/plain&SRS=EPSG:2193&BBOX="<BR>+ bbox1 + "," + bbox2 + "," + bbox3 + "," + bbox4 +<BR>"&WIDTH=20&HEIGHT=20&X=10&Y=10";"<BR><BR> It seems from the url that you r using ARCGIS with Mapserver. But if I am <BR>using<BR>only mapserver with openlayers then what is the url?<BR><BR>3) HOw do I make a layers queryable in the map file? What r the extra things<BR>I need to specify?<BR><BR>Pls reply soon.<BR>-- <BR>View this message in context: <A href="http://n2.nabble.com/Get">http://n2.nabble.com/Get</A>-Feature-Info-in-pop-up-working-example-tp4773944p4776299.html<BR>Sent from the OpenLayers Users mailing list archive at Nabble.com.<BR>_______________________________________________<BR>Users mailing list<BR>Users@openlayers.org<BR><A href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</A><BR><BR></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc. </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>