V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nilai
V2EX  ›  Android

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

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