public class Map: MKMapView
MKMapView
, MKMapViewDelegate
public init(lat latitude: Double, lon longitude: Double, points: (() -> [MapPoint])? = nil)
convenience init(region: MKCoordinateRegion, points: (() -> [MapPoint])? = nil)
@discardableResult func type(_ type: MKMapType) -> Self
@discardableResult func zoomEnabled(_ value: Bool = true) -> Self
@discardableResult func scrollEnabled(_ value: Bool = true) -> Self
@discardableResult func pitchEnabled(_ value: Bool = true) -> Self
@discardableResult func rotateEnabled(_ value: Bool = true) -> Self
Note: If delegate isn't its own class, modifiers based on delegate's methods will do nothing.
@discardableResult func delegate(_ delegate: MKMapViewDelegate?) -> Self
@discardableResult func zoom(_ multiplier: Double) -> Self
@discardableResult func visible(rect: MKMapRect, animate: Bool = true, edgePadding: UIEdgeInsets? = nil) -> Self
Changes coordinates and span.
@discardableResult func move(to region: MKCoordinateRegion, animate: Bool = true) -> Self
Changes only coordinates.
@discardableResult func move(to coordinates: CLLocationCoordinate2D, animate: Bool = true) -> Self
@discardableResult func center(_ center: CLLocationCoordinate2D, animated: Bool = true) -> Self
@discardableResult func show(annotations: [MKAnnotation], animated: Bool = true) -> Self
@discardableResult func show(annotations: MKAnnotation, animated: Bool = true) -> Self
@discardableResult func camera(boundary: MKMapView.CameraBoundary?, animated: Bool = true) -> Self
@discardableResult func set(cameraZoomRange: MKMapView.CameraZoomRange?, animated: Bool) -> Self
@discardableResult func camera(_ camera: MKMapCamera, animated: Bool = true) -> Self
@discardableResult func showBuildings(_ bool: Bool) -> Self
@discardableResult func showCompass(_ bool: Bool) -> Self
@discardableResult func showScale(_ bool: Bool) -> Self
@discardableResult func showTraffic(_ bool: Bool) -> Self
@discardableResult func pointOfInterestFilter(filter: MKPointOfInterestFilter?) -> Self
@discardableResult func showUserLocation(_ bool: Bool) -> Self
@discardableResult func user(trackingMode: MKUserTrackingMode, animated: Bool = true) -> Self
@discardableResult func select(annotation: MKAnnotation, animated: Bool = true) -> Self
@discardableResult func deselect(annotation: MKAnnotation, animated: Bool = true) -> Self
@discardableResult func remove(annotation: MKAnnotation) -> Self
@discardableResult func remove(annotations: [MKAnnotation]) -> Self
@discardableResult func add(annotation: MKAnnotation) -> Self
@discardableResult func add(point: MapPoint) -> Self
@discardableResult func add(annotations: [MKAnnotation]) -> Self
@discardableResult func add(points: [MapPoint]) -> Self
@discardableResult func register(classes: [String: AnyClass.Type]) -> Self
@discardableResult func fitTo(region: MKCoordinateRegion) -> Self
@discardableResult func fitTo(rect: MKMapRect, edgePadding: UIEdgeInsets? = nil) -> Self
@discardableResult func onFinishLoading(_ handler: @escaping (MKMapView) -> ()) -> Self
@discardableResult func afterRegionChange(_ handler: @escaping (MKMapView) -> ()) -> Self
@discardableResult func beforeRegionChange(_ handler: @escaping (MKMapView) -> ()) -> Self
@discardableResult func configure(identifier: String?, _ annotationView: @escaping ((MKAnnotationView?, MKAnnotation) -> (MKAnnotationView?))) -> Self
@discardableResult func onAccessoryTap(_ handler: @escaping (MKMapView, MKAnnotationView, UIControl) -> ()) -> Self
@discardableResult func onAnnotationViewStateChange(_ handler: @escaping ((MKMapView, MKAnnotationView, MKAnnotationView.DragState, MKAnnotationView.DragState) -> ())) -> Self
@discardableResult func onAnnotationSelect(_ handler: @escaping ((MKMapView, MKAnnotationView) -> ())) -> Self
@discardableResult func onAnnotationDeselect(_ handler: @escaping ((MKMapView, MKAnnotationView) -> ())) -> Self
public func mapViewDidFinishLoadingMap(_ mapView: MKMapView)
public func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool)
public func mapView(_ mapView: MKMapView, regionWillChangeAnimated animated: Bool)
public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView?
public func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl)
public func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState)
public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView)
public func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView)