Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw circle of certain radius on map view in Android

I want to draw a circle on map view. I want the user to input the radius and for that radius I have to show circle on map. After that I have to display markers on some locations on that circle.

I know how to display markers on on map view.

How can I draw circle on map view and to show markers on that circle boundary.

like image 501
Prabhu M Avatar asked May 17 '11 10:05

Prabhu M


1 Answers

Just to bring this up to date... they've made it very easy to do on Google Maps API v2.

    mMap.addCircle(new CircleOptions()
        .center(center)
        .radius(radius)
        .strokeWidth(0f)
        .fillColor(0x550000FF));

Where radius is in meters.

As for markers on the boundary, that should be relatively easy to do - just follow the 'Circles' Demo in the Google Maps sample code here: https://developers.google.com/maps/documentation/android/intro#sample_code

like image 180
warbi Avatar answered Oct 14 '22 11:10

warbi