&nbsp;Hi Stephen,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thanks for the hint. I was able to draw the circle, but now my problem is that I want to move the centroid of the circle to the point I click on the map.&nbsp; I used the following code in the mapscript<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layerObj oTempLayer = map.getLayerByName(&quot;Circle&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oTempLayer.open();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oTempLayer.status = (int)mapscript.MS_ON;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pointObj point = pixel2point(new pointObj(x, y, 0, 0));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rectObj oRect = oTempLayer.getExtent();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shapeObj oShp= oRect.toPolygon();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pointObj oPoint = oShp.getCentroid();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oPoint.setXY(point.x, point.y, 0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oShp.draw(map, oTempLayer, oImg);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oImg = map.draw();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oTempLayer.draw(map, oImg);<br><br>Can you please help me to rectify the above code?<br><br>Thanks,<br>Sucharita<br><br><div class="gmail_quote">On Sun, Apr 13, 2008 at 10:07 PM, Stephen Woodbridge &lt;<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Atul Dravid wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Try asking for Sample Code to Stephen Woodbridge...<div><div></div><div class="Wj3C7c"><br>
<br>
On 4/12/08, *Stephen Woodbridge* &lt;<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> &lt;mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>&gt;&gt; wrote:<br>

<br>
 &nbsp; &nbsp;Sucharita Samuel wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Hi all,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I want to draw a circle of 5 km radius around the point I<br>
 &nbsp; &nbsp; &nbsp; &nbsp;click on the map. I am using C# mapscript. Even if you can help<br>
 &nbsp; &nbsp; &nbsp; &nbsp;me with the php code, it will be of great help.<br>
<br>
<br>
 &nbsp; &nbsp;One way to do this is to create a template layer that defines a<br>
 &nbsp; &nbsp;feature that is a circle with the STATUS OFF. Then in mapscript you<br>
 &nbsp; &nbsp;can get the layer, set the status to ON and set the value of the<br>
 &nbsp; &nbsp;origin of the feature and have mapserver draw it on top of your map.<br>
<br>
 &nbsp; &nbsp;-Steve W.<br>
<br></div></div>
 &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp;mapserver-users mailing list<br>
 &nbsp; &nbsp;<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a> &lt;mailto:<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>&gt;<div class="Ih2E3d">
<br>
 &nbsp; &nbsp;<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
</div></blockquote>
<br>
In mapscript you can change the status and the feature points to be what you want. Here is an example of the LAYER and a URL to display it. I will leave the mapscript as you homework assignment :) Actually, I don&#39;t have a simple example handy, nor the time to put one together at the moment. If you get stuck an a specific point ask the list, there are plently of people that can help with mapscript.<br>

<br>
-Steve<br>
<br>
MAP<br>
 &nbsp;EXTENT -180 -90 180 90<br>
 &nbsp;IMAGECOLOR 255 255 0<br>
 &nbsp;IMAGETYPE png<br>
 &nbsp;SIZE 400 200<br>
 &nbsp;UNITS DD<br>
<br>
 &nbsp;LAYER<br>
 &nbsp; &nbsp;NAME &quot;circles&quot;<br>
 &nbsp; &nbsp;TYPE circle<br>
 &nbsp; &nbsp;STATUS DEFAULT<br>
 &nbsp; &nbsp;FEATURE<br>
 &nbsp; &nbsp; &nbsp;# define circle as two points describing the opposite corners of<br>
 &nbsp; &nbsp; &nbsp;# of the bounding square about the circle<br>
 &nbsp; &nbsp; &nbsp;POINTS<br>
 &nbsp; &nbsp; &nbsp; &nbsp;-10.0 -10.0<br>
 &nbsp; &nbsp; &nbsp; &nbsp; 10.0 &nbsp;10.0<br>
 &nbsp; &nbsp; &nbsp;END<br>
 &nbsp; &nbsp;END<br>
 &nbsp; &nbsp;CLASS<br>
 &nbsp; &nbsp; &nbsp;STYLE<br>
 &nbsp; &nbsp; &nbsp; &nbsp;OUTLINECOLOR 255 0 0<br>
 &nbsp; &nbsp; &nbsp;END<br>
 &nbsp; &nbsp;END<br>
 &nbsp;END<br>
END<br>
<br>
<a href="http://mt2.imaptools.com/cgi-bin/mapserv-5.1-dev?mode=map&amp;map=/u/data/maps/circles.map" target="_blank">http://mt2.imaptools.com/cgi-bin/mapserv-5.1-dev?mode=map&amp;map=/u/data/maps/circles.map</a><div><div>
</div><div class="Wj3C7c"><br>
<br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br>