Created
July 19, 2020 00:21
-
-
Save ts95/3417ef06192fd3128d486b0f9e9daf91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import MapKit | |
extension Map { | |
init<Items>( | |
coordinateRegion: Binding<MKCoordinateRegion>, | |
interactionModes: MapInteractionModes = .all, | |
showsUserLocation: Bool = false, | |
userTrackingMode: Binding<MapUserTrackingMode>? = nil, | |
annotationItems: Items | |
) where Content == _DefaultAnnotatedMapContent<Items>, | |
Items: RandomAccessCollection, | |
Items.Element == AnyMapAnnotationItem | |
{ | |
self.init( | |
coordinateRegion: coordinateRegion, | |
interactionModes: interactionModes, | |
showsUserLocation: showsUserLocation, | |
userTrackingMode: userTrackingMode, | |
annotationItems: annotationItems, | |
annotationContent: { $0.annotation } | |
) | |
} | |
init<Items>( | |
mapRect: Binding<MKMapRect>, | |
interactionModes: MapInteractionModes = .all, | |
showsUserLocation: Bool = false, | |
userTrackingMode: Binding<MapUserTrackingMode>? = nil, | |
annotationItems: Items | |
) where Content == _DefaultAnnotatedMapContent<Items>, | |
Items: RandomAccessCollection, | |
Items.Element == AnyMapAnnotationItem | |
{ | |
self.init( | |
mapRect: mapRect, | |
interactionModes: interactionModes, | |
showsUserLocation: showsUserLocation, | |
userTrackingMode: userTrackingMode, | |
annotationItems: annotationItems, | |
annotationContent: { $0.annotation } | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment