vishal vishal - 3 months ago 9
Java Question

How to draw a circle covering particular distance on map

I am using GoogleMap fragment to show some location data using markers. What I want to do is, draw a circle with a radius of specific distance on map, so that the circle will cover certain area approximately on map. I am not sure where to start , I am already having a map displaying location data, from location data I can figure out at what distance those points are from centre location.

Any help would be great.

Answer
CircleOptions circleOptions = new CircleOptions()
    .center(new LatLng(37.4, -122.1))
    .radius(1000)); // In meters

// Get back the mutable Circle
Circle circle = myMap.addCircle(circleOptions);

For detailed info check : https://developers.google.com/maps/documentation/android-api/shapes

Comments