I am using the new API(Google Map API V2) for my android application, i have done creating the map and adding markers to it, now my task is to manually create a circle around an
Using this method you can select any marker & it will create the circle object for particular marker. you can dynamically change radius of the circle by passing the marker object & radius value to the createCircle() method.
private GoogleMap mMap;
/*Create circle objects*/
Circle currentCircle;
/**
* create circle when user want to set region
* @param currentMarker this is user selected marker
* @param radius pass radius value to circle object
*/
private void createCircle(Marker currentMarker ,Double radius){
//check circle is exist or not
//if exist remove
if(currentCircle!=null){
currentCircle.remove();
}
currentCircle=mMap.addCircle(new CircleOptions().center(currentMarker.getPosition()).radius(radius)
.strokeColor(Color.parseColor("#FF007A93"))
.fillColor(Color.parseColor("#40007A93"))
.strokeWidth(2));
float zoomLevel = getZoomLevel(radius);
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(currentMarker.getPosition(), zoomLevel));
}