Draw circle of certain radius on map view in Android

后端 未结 6 788
一向
一向 2020-12-08 11:55

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 locat

6条回答
  •  轮回少年
    2020-12-08 12:32

    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

提交回复
热议问题