I have been working on a map overlay to show a 500 mile radius circle around a given address.
http://www.symhome.net/php/500MileTest.php I have it working the way I want it to at this point and time, but I am questioning if the radius is rendered to the correct size. Because according to a world map in my office, the circle should extend to the eastern border of Kansas City. Here is my code for the overlay. function drawCircle(lng,lat) { var Cradius = 500; // mile radius var Ccolor = '#ff0000'; // color red var Cwidth = 3; // width pixels var d2r = Math.PI/180; // degrees to radians var r2d = 180/Math.PI; // radians to degrees var Clat = (Cradius/3963)*r2d; // using 3963 as earths radius var Clng = Clat/Math.cos(lat*d2r); var Cpoints = []; for (var i=0; i < 33; i++) { var theta = Math.PI * (i/16); Cx = lng + (Clng * Math.cos(theta)); Cy = lat + (Clat * Math.sin(theta)); Cpoints.push(new GPoint(Cx,Cy)); }; map.addOverlay(new GPolyline(Cpoints,'#ff0000',5)); } I did edit my code to be inalign with this example, but then the circle did not show up at all. http://gmaps-samples.googlecode.com/svn/trunk/basic_wcircle/basicw_circle.htm Thanks in advance for any help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
