Hi Stephen,<br> 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. I used the following code in the mapscript<br>
<br> layerObj oTempLayer = map.getLayerByName("Circle");<br> oTempLayer.open();<br> oTempLayer.status = (int)mapscript.MS_ON;<br> pointObj point = pixel2point(new pointObj(x, y, 0, 0));<br>
rectObj oRect = oTempLayer.getExtent();<br> shapeObj oShp= oRect.toPolygon();<br> pointObj oPoint = oShp.getCentroid();<br> oPoint.setXY(point.x, point.y, 0);<br> oShp.draw(map, oTempLayer, oImg);<br>
oImg = map.draw();<br> 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 <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>> 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* <<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>> wrote:<br>
<br>
Sucharita Samuel wrote:<br>
<br>
Hi all,<br>
I want to draw a circle of 5 km radius around the point I<br>
click on the map. I am using C# mapscript. Even if you can help<br>
me with the php code, it will be of great help.<br>
<br>
<br>
One way to do this is to create a template layer that defines a<br>
feature that is a circle with the STATUS OFF. Then in mapscript you<br>
can get the layer, set the status to ON and set the value of the<br>
origin of the feature and have mapserver draw it on top of your map.<br>
<br>
-Steve W.<br>
<br></div></div>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a> <mailto:<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>><div class="Ih2E3d">
<br>
<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'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>
EXTENT -180 -90 180 90<br>
IMAGECOLOR 255 255 0<br>
IMAGETYPE png<br>
SIZE 400 200<br>
UNITS DD<br>
<br>
LAYER<br>
NAME "circles"<br>
TYPE circle<br>
STATUS DEFAULT<br>
FEATURE<br>
# define circle as two points describing the opposite corners of<br>
# of the bounding square about the circle<br>
POINTS<br>
-10.0 -10.0<br>
10.0 10.0<br>
END<br>
END<br>
CLASS<br>
STYLE<br>
OUTLINECOLOR 255 0 0<br>
END<br>
END<br>
END<br>
END<br>
<br>
<a href="http://mt2.imaptools.com/cgi-bin/mapserv-5.1-dev?mode=map&map=/u/data/maps/circles.map" target="_blank">http://mt2.imaptools.com/cgi-bin/mapserv-5.1-dev?mode=map&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>