现在就算手机放在那里不动,获取到的坐标还是不一样. 如何判断位置是否改变,如果没有发生改变就不记录坐标地址..
1
likaci May 17, 2014
好久不用百度的sdk了,应该提供类似的容差吧。不行的话直接比较两次的值也可以。
Android api 是可以的 public void requestLocationUpdates(long minTime, float minDistance, Criteria criteria, LocationListener listener) The minDistance parameter can also be used to control the frequency of location updates. If it is greater than 0 then the location provider will only send your application an update when the location has changed by at least minDistance meters, AND at least minTime milliseconds have passed. |
2
adeweb May 17, 2014
计算经纬度的偏移量,小于某个范围就不记录。
|