Google android maps v2 MetersToEquatorPixel [英] Google android maps v2 MetersToEquatorPixel
问题描述
我目前的任务是将Google Android maps v1应用程序转换为Google Android Maps V2应用程序。这个过程并不愉快(感谢谷歌)。
I am currently tasked with converting a Google Android maps v1 application over to Google Android Maps V2 application. The process is not a pleasant one (thanks google).
我的问题是,在之前的应用程序中,他们使用了一种称为您可以从Map的投影对象中获取metersToEquatorPixels 。
My problem is that in the previous application they used a nice little method of Google Android Maps v1 called metersToEquatorPixels that you could get from the Map's projection object.i.e.
int px =(int) (mapProjection.metersToEquatorPixels(radiusInMeters) * (1 / Math.cos(Math.toRadians(latitudeActual))));
但是,在谷歌Android地图V2中,我找不到这样一种方法。任何人都可以告诉我它在哪里,或者合适的替代品可能是什么?
However, in Google Android maps V2 there is not such a method I could find. Can anyone tell me where it is, or what a suitable replacement might be?
推荐答案
您不需要这样做,只需绘制一个圆圈,并以米为单位消除中心和半径
You dont need to do that, just draw a circle and pass away center and radius in meters
mMap.addCircle(new CircleOptions()
.center(latLng)
.radius(radiusInMeters)
.fillColor(Color.BLUE));
这篇关于Google android maps v2 MetersToEquatorPixel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!