'SwiftUI - MapAnnotation is showing up in wrong position
I am trying to display multiple map annotations to Apple Maps In SwiftUI, but the annotations are showing in some wrong perspective. All positions are displayed bellow their right coordinates. If I zoom in the map, annotations are "travelling" to their normal coordinates. Is there any "perspective" calculated by MapKit and is it possible to switch off this behaviour?
Marker displayed below normal position:
Marker displayed on his coordinates after zoom in:
Thank you!
Solution 1:[1]
I had this issue and i fixed it by changing the y position of the annotation to 1.0 like so:
MapAnnotation(coordinate: job.coordinates!, anchorPoint:.init(x:0.5, y:1.0))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Asi Givati |