<div dir="ltr">HI,<br>&nbsp;I have to display the user clicked point on the map. But i don get the point in the map.. Can any one please correct my code..<br>&lt;?php<br>dl(&#39;php_mapscript.dll&#39;);<br>&nbsp;// Default values and configuration<br>
$map_file=&quot;./usa12.map&quot;;<br>$map = ms_newMapObj($map_file);<br>if ( isset($HTTP_POST_VARS[&quot;mapa_x&quot;]) &amp;&amp; isset($HTTP_POST_VARS[&quot;mapa_y&quot;]))<br>&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $my_point = ms_newpointObj();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $my_point-&gt;setXY($HTTP_POST_VARS[&quot;mapa_x&quot;],$HTTP_POST_VARS[&quot;mapa_y&quot;]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $nGeoX = Pix2Geo($my_point-&gt;x, 0,$map-&gt;width , $map-&gt;extext-&gt;minx, $map-&gt;extent-&gt;maxx, 0);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $nGeoY = Pix2Geo($my_point-&gt;y, 0, $map-&gt;height, $map-&gt;extent-&gt;miny, $map-&gt;extent-&gt;maxy, 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $point=ms_newpointobj();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $point-&gt;setXY($nGeoX,$nGeoY);<br>$layer=$map-&gt;getLayerByName(&quot;US state boundaries&quot;);<br>
if (@$layer-&gt;queryByPoint($point,MS_SINGLE ,0) == MS_SUCCESS) <br>{&nbsp; <br>$image_from_query=$map-&gt;drawQuery();<br>$image_from_query_url=$image_from_query-&gt;saveWebImage();<br>}<br>}<br>function Pix2Geo($nPixPos, $dfPixMin, $dfPixMax, $dfGeoMin, $dfGeoMax, $nInversePix) <br>
{<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; $dfWidthGeo = $dfGeoMax - $dfGeoMin;<br>&nbsp;&nbsp;&nbsp; $dfWidthPix = $dfPixMax - $dfPixMin;<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; $dfPixToGeo = $dfWidthGeo / $dfWidthPix;<br><br>&nbsp;&nbsp;&nbsp; if (!$nInversePix)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $dfDeltaPix = $nPixPos - $dfPixMin;<br>
&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dfDeltaPix = $dfPixMax - $nPixPos;<br><br>&nbsp;&nbsp;&nbsp; $dfDeltaGeo = $dfDeltaPix * $dfPixToGeo;<br><br><br>&nbsp;&nbsp;&nbsp; $dfPosGeo = $dfGeoMin + $dfDeltaGeo;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return ($dfPosGeo);<br>&nbsp;&nbsp;&nbsp; <br>
}<br>&nbsp;$image=$map-&gt;draw();<br>&nbsp;$image_url=$image-&gt;saveWebImage();<br>?&gt;<br>map file<br>MAP<br>&nbsp;&nbsp;&nbsp; NAME USA1<br>&nbsp;&nbsp;&nbsp; STATUS ON<br>&nbsp;&nbsp;&nbsp; SIZE 800 500<br>&nbsp;&nbsp;&nbsp; IMAGETYPE PNG<br>&nbsp;&nbsp;&nbsp; IMAGECOLOR 200 200 200<br>&nbsp;&nbsp;&nbsp; SHAPEPATH &quot;C:\ms4w\Apache\data&quot;<br>
&nbsp;&nbsp;&nbsp; EXTENT -8000000 300000 5000000 1500000<br>&nbsp;&nbsp;&nbsp; UNITS METERS<br>&nbsp;&nbsp;&nbsp; PROJECTION<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;proj=lcc&quot; &quot;lat_1=32&quot; &quot;lat_2=44&quot; &quot;lat_0=38&quot; &quot;lon_0=-100&quot; &quot;x_0=0&quot; &quot;y_0=0&quot; &quot;ellps=GRS80&quot; &quot;datum=NAD83&quot;<br>
&nbsp;&nbsp;&nbsp; END<br>&nbsp;&nbsp;&nbsp; WEB<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGEPATH &quot;C:\ms4w\tmp\ms_tmp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGEURL &quot;C:\ms4w\tmp\ms_tmp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; END<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; LAYER<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME &quot;US state boundaries&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TYPE POLYGON<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STATUS ON<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DATA &quot;statesp020&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PROJECTION<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;proj=latlong&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;ellps=GRS80&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;datum=NAD83&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CLASS<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME &quot;US states&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OUTLINECOLOR 175 175 175<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COLOR 150 150 150<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SYMBOL 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TEMPLATE &quot;hello.html&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; END&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>END<br><br></div>