[英]How to convert geopoint longitude +latitude to double?
我正在检索地图视图的中心,我需要将双精度经度和纬度传递给服务器以针对数据库进行测试。
我将如何将mapView.getMapCenter()。getLongitudeE6()转换为double?
调用mapView.getMapCenter()
返回GeoPoint
。 GeoPoint.getLongitudeE6()
和GeoPoint.getLatitudeE6()
都返回微度(基本度* 1E6)。
因此,在Java中,只需将微度转换为度即可:
public static double microDegreesToDegrees(int microDegrees) {
return microDegrees / 1E6;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.