安卓的GeoPoint与纬度/长值纬度、GeoPoint

2023-09-12 07:34:31 作者:大耳朵猫

我想通过45.44334获得的GeoPoint为-23.4456

I am trying to get a GeoPoint for -23.4456 by 45.44334

我要传递到的GeoPoint的构造什么样的价值观,因为只需要整型。

What values do I pass into the constructor of the GeoPoint as it take Ints only.

推荐答案

的GeoPoint坐标为基础,在microdegrees(度* 1e6个) - 写的这里

GeoPoint coordinates are based in microdegrees (degrees * 1e6) -- written here

float lat = -23.4456f;
float lng = 45.44334f;
GeoPoint gp = new GeoPoint((int)(lat * 1E6), (int)(lng * 1E6));
 
精彩推荐
图片推荐