<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>Hi
All,</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>I have the following code that
creates a circle using googlemaps,</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>GEvent.addListener(map,
'click', mapClick);</FONT></SPAN></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>function mapClick(marker,
point) {<BR> var zoom = map.getZoom();<BR> <BR> if
(!centerMarker) {<BR> centerMarker =
createMarker(point)<BR> map.addOverlay(centerMarker);<BR> lat
= point.y.toFixed(6);<BR> lng =
point.x.toFixed(6);<BR> }<BR> else if
(!radiusMarker){<BR> if (rLine)
map.removeOverlay(rLine);<BR> radiusMarker =
point;<BR> drawCircle();<BR> var radOnEarth =
(centerMarker.getPoint().distanceFrom(radiusMarker)/1000).toFixed(3);<BR> ajax_loadContent('add_marker','add_circle.php?latbox='
+ lat + '&lonbox=' + lng +'&radius='+
radOnEarth);<BR> }<BR>}</FONT></SPAN></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>function
drawCircle(){<BR> var zoom = map.getZoom();<BR> var
centerPt = normalProj.fromLatLngToPixel(centerMarker.getPoint(),
zoom);<BR> var radiusPt = normalProj.fromLatLngToPixel(radiusMarker,
zoom);<BR> var circlePoints = Array();<BR>
with (Math) {<BR> var radius =
floor(sqrt(pow((centerPt.x-radiusPt.x),2) +
pow((centerPt.y-radiusPt.y),2)));</FONT></SPAN></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2> for (var a = 0 ; a
< 361 ; a+=10 ) {<BR> var aRad =
a*(PI/180);<BR> y = centerPt.y + radius *
sin(aRad)<BR> x = centerPt.x + radius *
cos(aRad)<BR> var p = new
GPoint(x,y);<BR> circlePoints.push(normalProj.fromPixelToLatLng(p,
zoom));<BR> }<BR> if (circleLine)
map.removeOverlay(circleLine);<BR> circleLine = new
GPolyline(circlePoints,'#FF0000',2,1);<BR> map.addOverlay(circleLine);<BR> }<BR>}</FONT></SPAN></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>function createMarker(point)
{<BR> var marker = new GMarker(point);<BR> return
marker;<BR>}</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>now i am rewriting my app with
openlayers and have a small problem</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>has anyone done something
similar to this ?</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial size=2>basically i click on the map to
add a center point then the seconf click is the size of the circle, this then
calls a form so i can give this circle a name</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2>simple</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=671343709-12092008><FONT face=Arial
size=2>K-</FONT></SPAN></DIV></DIV></SPAN>
<DIV> </DIV>
</BODY></HTML>