Convert GeoPoint to Location

2019-01-17 20:41发布

问题:

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.

回答1:

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

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