MKMapView's user location is wrong on startup or resume

前端 未结 7 1982
臣服心动
臣服心动 2021-01-17 19:15

When I start my application fresh, or resume after a long time, MKMapView\'s notion of the userLocation is wrong and shows me in the middle of the sea.

I am using th

7条回答
  •  迷失自我
    2021-01-17 19:48

    What I do here is-

    1. start location updates
    2. on location update, check the age of location, if it's too old, I wait
    3. on receiving new update I update it on the map

    If you need very accurate location, then put a check on accuracy as well and a timeout beyond which you can't tolerate waiting and use the less accurate fix.

提交回复
热议问题