Google, on Feb 26, released Circle
as an overlay type:
https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Circle
But how do I update to the new release of Google Map V2? When will it be available in Android SDK Manager? I have the previous Google Map V2 library within "Google Play Services" (Rev. 5) which does NOT include Circle
class
The radius option will enable you to draw a circle in miles or traveling distance (in time) from any specific location, incorporating all directions up to the maximum. The radius map tool allows users to determine distances between a location and specific markers that fall within the area.
To update Google MAP V2:
Open Android SDK Manager -> Go to Extras -> Check for the update of Google Play Service. if it doesn't shows the update available, then go to Packages->Reload. update the google play service to Revision 5.
After that remove the old Google Play Service Library project from Eclipse Workspace. import it again. add this library project in your current project. now u will have the Circle class available under com.google.android.gms.maps.model package. and you can use that to add circle in your map.
To Add Circle:
mMap.addCircle(new CircleOptions()
.center(new LatLng(location.getLatitude(), location.getLongitude()))
.radius(100)
.strokeColor(Color.RED)
.fillColor(Color.BLUE));
And for your information, this is Release note for changes of February 2013.
EDIT : This is Release notes for June 2016. You can now make the circles clickable, which may be helpful if you want to do some action with circle.
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