HowTo initialise MKMapView with a given user location?

后端 未结 4 464
滥情空心
滥情空心 2020-12-04 09:14

My app knows the current user position (CoreLocation.framework). As soon as the user opens a new MapView his iPhone starts searching for the current position again. Is it p

4条回答
  •  余生分开走
    2020-12-04 09:36

    You don't need to use another Location Manager, you can add whatever points you want to the map and update them via whatever other logic you want.

    Let's say you had a socket connection to a remote control car, and that car send back socket data containing geo-location information in the payload. You could parse that out, and update the location of the thumbnail on your map in real time. The "userLocation" property is not needed for that, but you could show it if you wanted to.

    The location of the user is read-only, you can use it or not. That doesn't mean you need another location manager to do anything you might need to do. It sounds like your app doesn't really need that feature, but I could be misunderstanding your question.

提交回复
热议问题