0

I am working on an application with a map Kit View. I want the user to be able to center himself and then keep him centered until he touches the map again. The Apple Maps app has a built in button to do this, and I was therefore wondering if there was an easy way to add this to my own project, just like you can do with the compass.

enter image description here

I have made a video in Apple Maps where I do what I would like my own map to be able to do. enter image description here

If there is something I am not explaining good enough please tell me and I will edit my question.

zeytin
  • 5,545
  • 4
  • 14
  • 38
Chris
  • 85
  • 1
  • 4
  • 16
  • What do you need help with exactly? Adding the button or making the map track the user. The latter is accomplished via the `userTrackingMode` property of the map view. – Paulw11 Dec 27 '20 at 20:17
  • @Paulw11 First I wanted to add a compass to my map. Instead of making my own from scratch, I found that you could just add the one that is used in Apple Maps (https://stackoverflow.com/questions/48713377/how-to-show-mapkit-compass). So my question is if you are able to do the same with the other buttons that I have pointed out? If it is not possible, I would be glad if you would care to explain how to use userTrackingMode :) – Chris Dec 27 '20 at 20:29
  • https://developer.apple.com/documentation/mapkit/mkusertrackingbutton – Paulw11 Dec 27 '20 at 20:32
  • @Paulw11 Wow, that might be it! Maybe you could make an answer where you demonstrate how to use it? – Chris Dec 27 '20 at 20:36

0 Answers0