Map: onTapGesture not working
The onTapGesture is not working inside the ViewMapAnnotation, here is my code:
`Map(
coordinateRegion: $region,
type: .standard,
pointOfInterestFilter: .includingAll,
interactionModes: [.all],
annotationItems: evChargerManager.evChargers,
annotationContent: { charger in
ViewMapAnnotation(coordinate: (charger.addressInfo?.coordinates)!) {
Image(K.Images.SupplementarilyIcons.pinpoint)
.resizable()
.frame(width: 40, height: 40, alignment: .center)
.onTapGesture {
showingSheet.toggle()
}
.sheet(isPresented: $showingSheet) {
EVChargerView(evCharger: charger)
} //: SHEET
} //: VIEW MAP ANNOTATION
} //: ANNOTATION CONTENT
) //: MAP`
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 23 (4 by maintainers)
@IraklisElef As I thought, the problem is not connected with the Map library. To show the sheet correctly, try the following code: