-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotations aren't immobile and move with zoom #49
Comments
As described in the readme, please do not create your MKOverlay instances inside the body-property of your view, since this means that the overlay instances do not have fixed pointer values (i.e. the ObjectIdentifier is different for each run) and that means that the overlays will constantly be removed and added again for each call of the view's body. Please make sure to have them wrapped in Having said that, you seem to be using |
I have the same issue without overlay, I just rename map and MapViewAnnotation to understand the error. I have the same issue with this code. struct ContentView: View {
} |
@pauljohanneskraft I analyzed the problem, and it seems have an issue with the function private func updateRegion(on mapView: MKMapView, from previousView: Carte?, to newView: Carte, animated: Bool) in the coordinator ( for iOS 16). When the region is not set, the annotations don't move when you zoom. Moreover when I tried to zoom in to the maximum, I have the error on my debugger screen : Wrapped around the polygon without finishing... :-( I don't know if you have ever had this kind of problem. |
I'm having this issue as well. Has there been a fix or workaround yet? |
When I use ignoreSafeArea or edgesIgnoringSafeArea(.all) in my code and if I zoom, my annotations aren't immobile and move.
To fix the problem I have to add a title with a VStack above my map
Some one have an idea of the problem ?
Thank you
Good work with the package, it's really impressive
Carte(coordinateRegion: $region ,type: MKStandardMapConfiguration() , userTrackingMode: $userTrackingMode ,annotationItems: MockedDataMapAnnotation,
annotationContent: { location in
CarteAnnotation(coordinate: CLLocationCoordinate2D(latitude: location.latitude, longitude: location.longitude)) {
VStack(spacing: 0) {
Image(systemName: "map")
.resizable()
.scaledToFit()
.frame(width: 15, height: 15)
.font(.headline)
.foregroundColor(Color.black)
.padding(6)
.background(Color.white)
.clipShape(Circle())
Image(systemName: "triangle.fill")
.resizable()
.scaledToFit()
.foregroundColor(.black)
.frame(width: 10, height: 10)
.rotationEffect(Angle(degrees: 180))
.offset(y: -1.5)
.padding(.bottom, 40)
}
}
},
overlays: [
MKPolyline(coordinates: polylineCoordinates, count: polylineCoordinates.count)
],overlayContent: { overlay in
RendererCarteOverlay(overlay: overlay) { _, overlay in
The text was updated successfully, but these errors were encountered: