Distance of two geo point android

不羁的心 提交于 2020-01-23 19:00:51

问题


I am new android application developer. I have create a mapview application where i need to calculate the distance of two geo point.How can i do that.


回答1:


Use the Location.distanceBetween method:

GeoPoint prev, current;
float[] results = new float[3];
Location.distanceBetween(prev.getLatitudeE6()/1E6, prev.getLongitudeE6()/1E6, current.getLatitudeE6()/1E6, current.getLongitudeE6()/1E6, results);


来源:https://stackoverflow.com/questions/6283028/distance-of-two-geo-point-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!