【问题标题】:GeoLocator PositionChanged event is triggered too oftenGeoLocator PositionChanged 事件触发太频繁
【发布时间】:2013-11-16 03:03:00
【问题描述】:

我正在将 GeoLocator 类用于位置感知应用程序,我希望每分钟更新一次位置以节省电池电量。我已经相应地设置了 ReportInverval 属性,但是 PositionChanged 事件被更频繁地触发。这里有什么问题?

App.Geolocator = new Geolocator();
App.Geolocator.DesiredAccuracy = PositionAccuracy.High;
App.Geolocator.MovementThreshold = 100; 
App.Geolocator.ReportInterval = 1000*60; //report change every minute
App.Geolocator.PositionChanged += geolocator_PositionChanged;

【问题讨论】:

    标签: c# windows-phone-8 geolocation


    【解决方案1】:

    这应该每分钟给你一个位置,但文档确实说:

    如果另一个应用程序请求更频繁的更新,通过为 ReportInterval 指定更小的值,您的应用程序可能会以比请求更高的频率接收更新

    【讨论】:

      【解决方案2】:

      找出它不工作的原因。解决方案是不使用 MovementTreshold,因为它优先于 ReportInterval。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-04-02
        • 2019-11-18
        • 1970-01-01
        • 1970-01-01
        • 2012-10-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多