nilai
V2EX  ›  Android

百度地图如何判定位置是否改变

  •  
  •   nilai · May 17, 2014 · 14465 views
    This topic created in 4578 days ago, the information mentioned may be changed or developed.
    现在就算手机放在那里不动,获取到的坐标还是不一样. 如何判断位置是否改变,如果没有发生改变就不记录坐标地址..
    2 replies  •  2014-05-17 19:09:52 +08:00
    likaci
    likaci
    May 17, 2014
    1
    好久不用百度的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.
    adeweb
    adeweb
    May 17, 2014
    2
    计算经纬度的偏移量,小于某个范围就不记录。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1932 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 12:12 · PVG 20:12 · LAX 04:12 · JFK 07:12
    ♥ Do have faith in what you're doing.