Skip to content
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

ViewMapAnnotation does not allow text #21

Closed
ale-ben opened this issue Jul 30, 2022 · 2 comments
Closed

ViewMapAnnotation does not allow text #21

ale-ben opened this issue Jul 30, 2022 · 2 comments

Comments

@ale-ben
Copy link

ale-ben commented Jul 30, 2022

I'm trying to make an annotation with text and icon (like the official POI's in apple maps) but the text is not displayed.

This is the code I'm using, with SwiftUI maps it works but with this library it doesn't.

Map(
  coordinateRegion: $region,
  pointOfInterestFilter: .excludingAll,
  annotationItems: POIList){ item in
    ViewMapAnnotation(coordinate: item.coordinate) {
        VStack{
            Text("Text Here")
            Image(systemName: "leaf.circle.fill")
            
        }
        //MapPOIElementView(POI: item)
    }
  }

Expected result (MapKit):
Screenshot 2022-07-30 at 16 47 41

Actual result (Map):
Screenshot 2022-07-30 at 16 44 05

@pauljohanneskraft
Copy link
Owner

Hey @ale-ben ! I have just tried this out and can confirm that this is an issue at the moment - I tried putting .fixedSize() on the view and it seems to have fixed the issue - can you confirm that this is the case?

This is only required as a temporary workaround though, as I will make sure that this is handled by the framework itself - thank you for letting me/us know!

@ale-ben
Copy link
Author

ale-ben commented Aug 2, 2022

Sorry for the late reply, can confirm that with .fixedSize() labels are shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants