<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>In my OpenLayers code I register a click event on the map. This captures the x,y of the click point, then computes a bounding box which is then used to create WMS GetFeatureInfo request. The return from that request can then be parsed, with values put into a div on the page or put into a pop-up window.</DIV>
<DIV> </DIV>
<DIV>//Here is the click event code:</DIV>
<DIV>map.events.register('click', map, function (e) {<BR> var xys = map.getLonLatFromViewPortPx(e.xy);<BR> easting = xys.lon;<BR> northing = xys.lat;<BR> OpenLayers.Util.getElement('coords').innerHTML = "<strong>x:</strong>" + parseInt(easting) + " <strong>y:</strong>" + parseInt(northing);<BR> if (mode == "qry") {<BR> var bbox1 = easting - 10;<BR> var bbox2 = northing - 10;<BR> var bbox3 = easting + 10;<BR> var bbox4 = northing + 10;<BR> OpenLayers.Util.getElement('comments').innerHTML = "Looking for parcel details... please wait...";<BR> var regc = "<A href="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">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</A>=" + bbox1 + "," + bbox2 + "," + bbox3 + "," + bbox4 + "&WIDTH=20&HEIGHT=20&X=10&Y=10";<BR> OpenLayers.loadURL(regc, '', this, setHTML2); <BR> }<BR> Event.stop(e);<BR> });</DIV>
<DIV> </DIV>
<DIV>//Here is the function to get the response:</DIV>
<DIV> function setHTML2(response2) {<BR> var ta = "";<BR> var rc = "";<BR> if (response2.responseText.indexOf('no results') != -1) {<BR> ta="Outside NZ";<BR> }<BR> else {<BR> var lines = response2.responseText.split('\n');<BR> var vals = lines[1].replace(/^"/,'').replace(/\s$/,'').replace(/"$/,'').split('" "');<BR> ta = vals[5];<BR> rc = vals[7];<BR> }<BR> OpenLayers.Util.getElement('region').innerHTML = "<small>" + ta + " : " + rc + "</small>";<BR> }</DIV>
<DIV> </DIV>
<DIV>regards,</DIV>
<DIV> </DIV>
<DIV>Robert Sanson</DIV>
<DIV><BR>>>> sunny74 <sb.ray@hotmail.com> 22/03/2010 7:33 a.m. >>><BR><BR>Dear Friends,<BR><BR>Does anybody have a working example of Get Feature Info in POP up where the<BR>map file is pointing to and getting attribute data from the shape files?<BR><BR><BR>If so pls give a step by step description of what you have done along with<BR>the code.Also the mapfile changes that you have done to get it working.<BR><BR>Pls reply soon.<BR><BR>Thanks for your attention and efforts.<BR><BR><BR><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-tp4773944p4773944.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>