How to convert geopoint longitude +latitude to double?

前端 未结 1 1651
感动是毒
感动是毒 2021-01-06 11:03

I am retrieving the center of a map view and i need to pass the longs and lats as doubles to my server for testing against the database .

How would i go about conve

相关标签:
1条回答
  • 2021-01-06 11:42

    Calling mapView.getMapCenter() returns a GeoPoint. GeoPoint.getLongitudeE6() and GeoPoint.getLatitudeE6() both return microdegrees (basically degrees * 1E6).

    So, in Java, to convert microdegrees to degrees simply do:

    public static double microDegreesToDegrees(int microDegrees) {
        return microDegrees / 1E6;
    }
    
    0 讨论(0)
提交回复
热议问题