Domanda

I would like to have a annotation in the center of the map, that does not move when the region is changed. That is, when one moves the map, the annotation stays in the center regardless. I have implemented this using NStimer, assigning the map center coordinate to the annotation every .001 seconds, however this is very choppy and doesn't look smooth.

I realize that I need to use an Overlay than convert the overlay annotation to coordinates on the map.

Pretty much it would look like what Uber has.

È stato utile?

Soluzione

THe other solutions for this that I have seen have not used a normal annotation. Instead they put another view over the top of the map with the annotation image in the middle. It doesn't matter what happens to the map the view stays centered on the screen and if you do ever need to interact with it, you just ask the map what the center coordinate is at that time.

Altri suggerimenti

You can get the code from the following link: https://github.com/scottrhoyt/CenterPinMapViewController

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top