大家好,我有两个问题
1)我无法找出Location.distanceBetween以哪个单位接收纬度和经度。是度还是微度?返回的距离的单位是多少?
很抱歉这个菜鸟问题,但我无法在文档中找到任何内容。
2)在Windows XP中使用Eclipse 3.3.2。仿真器无法正确发送坐标。手动或通过加载gpx文件都不会调用locationListener。我在Ubuntu中尝试过的相同代码,效果很好。有人知道我该怎么解决吗?在办公室中没有安装linux,我可以带上我的个人笔记本电脑。
非常感谢高级!
最佳答案
1)从android来源:
public static void distanceBetween(double startLatitude, double startLongitude,
double endLatitude, double endLongitude, float[] results) {
if (results == null || results.length < 1) {
throw new IllegalArgumentException("results is null or has length < 1");
}
computeDistanceAndBearing(startLatitude, startLongitude,
endLatitude, endLongitude, results);
}
在computeDistanceAndBearing内部,有一条注释说:
// Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
// using the "Inverse Formula" (section 4)
我会在那里检查
2)
去:
设定值
应用领域
发展历程
检查“允许模拟位置”是否打开。