问题
I have a problem with iPhone GPS ; i'm trying to record a track that is not on a street , but each time I pass near a street ( look at enclosed image ) it seems to me that the gps output is corrected with maps data ; Is there a way to disable this beahviour ? I need the precise point in my app

回答1:
To avoid the "snap to road" feature, set the activityType
to CLActivityTypeOtherNavigation
. All other values (Other, Fitness, AutoNav) for activityType will snap to the nearest road.
This was the advice we received from an Apple engineer at WWDC recently. We also verified this (on iOS 7.1.2) by taking 4 iPhone 5 devices (one for each activityType, plus a Trimble GPS for reference) and doing extensive testing on and off roads (see map below).
We have not tested on iOS 8 yet, this behavior could change, since it is undocumented.
Caution: if there is more than one instance of CLLocationManager
in your app, they must be set to the same activityType
. If they have different values, the first one started may be the one that determines how they all behave, we had problems with this too. MKMapView
creates its own CLLocationManager
, for example.
Here is a sample of our test results. The orange line is CLActivityTypeOtherNavigation
, the blue, green and red are the other 3 activity types. You can see that the blue, green and red follow the center line of the road, while the orange line uses the raw GPS position.

回答2:
Your post was shocking me, I immediately tried it out on my app.
On ios6 using Apples MKMapKit, positions are not snapped to a near street. At least not with standard settings.
(Neither on ios5)
I wonder how the app is able to snap to the next street, I know how to do that pricipally, but the vector data are not available from Apple.
So please can you talk with the SW developers of the App how they snap to the next road? (Using OpenStreetMap vector data this could work, but Apple uses TomTom vector data which are not public available)
来源:https://stackoverflow.com/questions/16101051/control-ios-gps-input