我目前的任务是将Google
Android地图v1应用程序转换为Google Android Maps V2应用程序.这个过程不是一个愉快的过程(感谢谷歌).
我的问题是,在之前的应用程序中,他们使用了一个名为meterToEquatorPixels的Google Android地图v1的小方法,你可以从Map的投影对象中获得.
int px =(int) (mapProjection.metersToEquatorPixels(radiusInMeters) * (1 / Math.cos(Math.toRadians(latitudeActual))));
但是,在Google Android地图V2中,我找不到这样的方法.任何人都可以告诉我它在哪里,或者什么是合适的替代品?
最佳答案 你不需要这样做,只需绘制一个圆圈并以米为单位传递中心和半径
mMap.addCircle(new CircleOptions()
.center(latLng)
.radius(radiusInMeters)
.fillColor(Color.BLUE));