Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The most efficient way is to throttle is based on time. The docs have already been quoted in another answer, but it should be obvious that the device has to take distance measurements and filter them before getting to you to compute a distance threshold, whereas a time threshold allows the device to avoid taking location measurements. </p> <p>I would encourage you to use a fixed time for polling, thus only needing to set the updates up once. Ask yourself this question -- "How quickly does my app need to know about a change in distance (any distance)?" If you can put a single number on it (1 sec, 100sec, whatever), use that as your update time. You can use minDistance, too, if you want to avoid extra calls to your callback function.</p> <p>Note that your thresholds are already in "time". You are computing a speed (mph) and you have a distance threshold (meters, I assume, since "MovementThreshold" in WP7 is in meters), you can easily compute the time it would take to move the distance in your threshold (distance/speed and account of the change in units) and use that number as your minTime because you know any measurement prior to the time should not be greater than your distance threshold unless the device has changed speed. This gives you the sliding scale you are looking for, but using the more efficient minTime.</p> <p>In the event of a change of speed, your polling time will be off until you get your first read at the new speed. I suspect this does not matter to you, because if detecting these changes at a high resolution was important, you'd probably already be polling based on time instead of distance. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload