转换的GeoPoint到位置位置、GeoPoint

2023-09-13 23:42:24 作者:叼根棒棒糖闯天下

我知道这是一个非常noobish的问题 - 但什么是转换GeoPoint到Location在Android平台。

解决方案

 双纬度= geoPoint.getLatitudeE6()/ 1E6;
双经度= geoPoint.getLongitudeE6()/ 1E6;

location.setLatitude(纬度);
location.setLongitude(经度);
 

I know this is a very noobish question -- but what is the best way to convert a GeoPoint to a Location on the Android platform.

解决方案 ES 位置查询之geo point

double latitude = geoPoint.getLatitudeE6() / 1E6;
double longitude = geoPoint.getLongitudeE6() / 1E6;

location.setLatitude(latitude);
location.setLongitude(longitude);