答案 0 :(得分:0)
if (circle != null) circle.setRadius(0); return;
double radius = 1000 * range;//range would be in meters
if (circle != null) {
circle.setCenter(mMap.getCameraPosition().target);
circle.setRadius(radius);
} else {
circle = mMap.addCircle(new CircleOptions()
.center(mMap.getCameraPosition().target)
.radius(radius)
.strokeWidth(5f)
.strokeColor(0x80ED1F29)
.fillColor(0x1A00B200));
}
注意:range = radius in meter和circle将是全局变量