-1

seems like accuracy of the user location is somewhat of when cellular data is not available? Can I adjust how often user location is updated? Is there an example of user location adjustment to streets/roads/driveways? As you can see below line is way off the road.

enter image description here.

kos
  • 1,357
  • 9
  • 21

1 Answers1

2

Is geolocation accuracy affected when cellular data is not available?

Sometimes. The GPS source specifically does not depend on cellular, but positions are ultimately provided by the OS, which may use cell towers and nearby wi-fi when available to refine the location.

I don't know the scale of your map apart from using the cars/trucks on the pictured main road as references, but the distances involved appear large enough that the absence of cellular should not cause large jumps (but probably noisier lines).

Can I adjust how often user location is updated?

Indirectly, but yes. You can play with the desiredAccuracy, distanceFilter and activityType properties of the MGLLocationManager (accessible as the locationManager property of your MGLMapView).

The idea is to reduce the desired accuracy and distance filter so that you get noisier but more frequent positions. Setting activityType to CLActivityType.fitness might help as well.

Is there an example of user location adjustment to streets/roads/driveways?

You can check out Mapbox's Map Matching API, which is powered by the matching service of the OSRM (Open Source Routing Machine) engine.

Example of a Map Matching on Mapbox

Rafael Almeida
  • 10,352
  • 6
  • 45
  • 60