I am working on map code migration from v2 to v3.
In v2 i have create circle with help of GProjection and Overlay and it will look same size in all zoom level.
In v3 google gives Circle class that will create circle in map but it will change in different zoom level.
I want to create circle that will have same size in all zoom level.
I want to know any other way in google map v3 by that i can create circle with same size for all zoom level.
Thanks in advance.
We found two handy tools that you can use to draw a radius on your map. One is CalcMaps, and the other one is Maps.ie. If you're using CalcMaps, click on Draw a circle and add the circle on the map area you're interested in. Use can then use the drop-down menu to select the radius type you want to use.
Zoom in the mapDouble tap a spot on the map, and then: Drag down to zoom in. Drag up to zoom out.
Click on the map and create a popup marker to select the point. From there, opt for the “Draw Radius.” Choose the proximity distance from the given address found within the radius options in the software. Once settings are entered, a map will show the highlighted parameters on the map.
Drawing the RadiusSelect the radius and proximity tool from the left-hand menu. Depending on your needs, choose either distance radius or drive time polygon. Enter your locations and the distance you would like your radius to reach from the center point. Customize your map with color-coding and labeling tools.
To create circles that are the same pixel size on the screen (versus same area size in geographic coordinates), you would traditionally use a Marker with a custom Icon in the shape of a circle. But now you can be more flexible and use the relatively new Symbols in v3.
var marker = new google.maps.Marker({ position: new google.maps.LatLng(-122.5,47.5), icon: { path: google.maps.SymbolPath.CIRCLE, fillOpacity: 0.5, fillColor: '#ff0000', strokeOpacity: 1.0, strokeColor: '#fff000', strokeWeight: 3.0, scale: 20 //pixels } });
Aside: You can make cool animations out of these symbols as well: http://googlegeodevelopers.blogspot.com/2012/06/powerful-data-visualization-with.html
I use this code to manage zoom and scaling circles on my Google Map V3:
google.maps.event.addListener(iMap.map, 'zoom_changed', function () { for (var i = 0; i < iMap.circle.length; i++) { var p = Math.pow(2, (21 - iMap.map.getZoom())); iMap.circle[i].setRadius(p * 1128.497220 * 0.0027); } menu.hide(); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With