http://maps.forum.nu/gm_sensitive_circle2.html
-- Marcelo - http://maps.forum.nu -- On Sep 24, 9:53 pm, "[email protected]" <[email protected]> wrote: > I found this code > herehttp://maps.examples.googlepages.com/highlightmarker.html > and got it to make a circle at a point but the size is based on the > zoom level (I think) as opposed to a unit like miles or kilometers I > was wondering how much work or where I'd go about changing it to base > it on miles or kilometers. How I'm using it can be seen > here:http://www.jove.com/resources/php/videographers/this_videographer2.php. > Thanks for any help you can offer. > > function highlightCurrentMarker() { > var polyPoints = Array(); > var mapNormalProj = G_NORMAL_MAP.getProjection(); > var mapZoom = map.getZoom(); > var clickedPixel = > mapNormalProj.fromLatLngToPixel(endlocation, > mapZoom); > alert (clickedPixel); > var polySmallRadius = 100; > var polyNumSides = 20; > var polySideLength = 18; > for (var a = 0; a < (polyNumSides+1); a++) { > var aRad = polySideLength*a*(Math.PI/180); > var polyRadius = polySmallRadius; > var pixelX = clickedPixel.x + polyRadius * > Math.cos(aRad); > var pixelY = clickedPixel.y + polyRadius * > Math.sin(aRad); > var polyPixel = new GPoint(pixelX,pixelY); > var polyPoint = > mapNormalProj.fromPixelToLatLng > (polyPixel,mapZoom); > polyPoints.push(polyPoint); > } > // Using GPolygon(points, strokeColor?, > strokeWeight?, > strokeOpacity?, fillColor?, fillOpacity?) > highlightCircle = new GPolygon(polyPoints,"#000000", > 2,1.0,"#0000FF",.5); > map.addOverlay(highlightCircle); > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
