我希望用户仅在Google地图的精度圆内拖动标记,我尝试使用LatLngBounds创建边界,但边界始终是矩形。我检查了很多示例,但没有找到解决方法。
LatLngBounds createBoundsWithMinDiagonal(@NonNull Location location) {
LatLng center = new LatLng(location.getLatitude(), location.getLongitude());
double radius = location.getAccuracy();
return new LatLngBounds.Builder().
include(SphericalUtil.computeOffset(center, radius, 0)).
include(SphericalUtil.computeOffset(center, radius, 90)).
include(SphericalUtil.computeOffset(center, radius, 180)).
include(SphericalUtil.computeOffset(center, radius, 270)).build();
}