You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Map library to implement a Map where is showed some ViewMapAnnotation, as much as the user wants to show, but I'm not able to show a simple Text under the Image that represents the single annotation
I really hope that someone can help me because this is a project that I'm developing for the final exam at university 😄
P.S. Sorry, but I'm not able to use properly the code function of GitHub because every time that I paste the code, GitHub adds to it a lot of tab at the beginning of every line
The text was updated successfully, but these errors were encountered:
Hey - what happens, if you put .fixedSize(horizontal: false, vertical: true) on that VStack? You might also want to simply define a fixed width using the frame view modifier.
If this doesn't work, you might want to have a look at the two currently open PRs handling a similar issue #40#25 - I haven't tested them yet unfortunately.
If both of them don't work, you might want to build a custom annotation by creating a new type conforming to the MapAnnotation protocol. Take a look at MapPin or MapMarker implementations for some inspiration. The ViewMapAnnotation is a bit more complicated, but it might also help - especially if you still want to use SwiftUI for the content.
I'm trying to use Map library to implement a Map where is showed some ViewMapAnnotation, as much as the user wants to show, but I'm not able to show a simple Text under the Image that represents the single annotation
This is my code for the map implementation:
Map(coordinateRegion: $searchService.region,
type: selectedMapStyle,
pointOfInterestFilter: .excludingAll,
informationVisibility: .default.union(.userLocation),
interactionModes: .all,
userTrackingMode: $userTracking,
annotationItems: selectedLandmark,
annotationContent: { location in
ViewMapAnnotation(coordinate: location.coordinate, title: location.name) {
VStack{
Image(systemName: "mappin.circle.fill")
.foregroundColor(.red)
.font(.title)
.padding()
I really hope that someone can help me because this is a project that I'm developing for the final exam at university 😄
P.S. Sorry, but I'm not able to use properly the code function of GitHub because every time that I paste the code, GitHub adds to it a lot of tab at the beginning of every line
The text was updated successfully, but these errors were encountered: