Waheed
Waheed

Reputation: 63

Android- Google map v2 Draw circle

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

Upvotes: 6

Views: 14676

Answers (1)

KunalK
KunalK

Reputation: 1904

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.

Upvotes: 35

Related Questions