how to limit zoom level in map swift ui i have map and need to make zoom level limited
Map(coordinateRegion: $region,annotationItems: viewModel.nearbyGyms) { item in
MapAnnotation(coordinate: CLLocationCoordinate2D.init(latitude: item.geometry?.location?.lat ?? 0.0, longitude: item.geometry?.location?.lng ?? 0.0)) {
NavigationLink(destination:Text("Details")) {
VStack {
if item.photos?.first?.photoReference != nil {
ImageView(photoReference: item.photos?.first?.photoReference)
} else {
ImageView(photoReference: item.photos?.last?.photoReference)
}
Text(item.name ?? "unknown")
.lineLimit(1)
.scaleEffect(0.8)
}
}
}
}