Google android maps v2 MetersToEquatorPixel

假装没事ソ 提交于 2019-12-10 15:49:33

问题


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).

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))));

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?


回答1:


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));


来源:https://stackoverflow.com/questions/24071133/google-android-maps-v2-meterstoequatorpixel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!