Control iOS gps input

一世执手 提交于 2019-12-07 03:59:12

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!