2014-06-05 139 views
4

我目前的任務是將Google Android maps v1應用程序轉換爲Google Android Maps V2應用程序。這個過程並不愉快(感謝谷歌)。Google android maps v2 MetersToEquatorPixel

我的問題是,在以前的應用程序他們使用谷歌Android地圖的一個可愛的小法V1稱爲metersToEquatorPixels,你可以從地圖投影object.i.e得到。

int px =(int) (mapProjection.metersToEquatorPixels(radiusInMeters) * (1/Math.cos(Math.toRadians(latitudeActual)))); 

但是,在谷歌Android地圖V2中沒有我能找到的這種方法。任何人都可以告訴我它在哪裏,或者一個合適的替代品可能是什麼?

回答

2

你不需要做的,只是畫一個圓而去世米

mMap.addCircle(new CircleOptions() 
    .center(latLng) 
    .radius(radiusInMeters) 
    .fillColor(Color.BLUE)); 
+0

你是正確的圓心和半徑。 Google maps V2似乎不再需要這種轉換方法,因爲測量單位在所有命令和功能中更加統一。 –