TKUIMapManager

open class TKUIMapManager : TGMapManager

The base class for map managers in TripKitUI

The following diagram illustrates the relationships:

┌────────────────────────────────────────────────────────────────────┐
│ TGCardViewController                                               │
│ ┏━━━━━━━━━━━━━━━━━━━┓                   ╔════════════════════════╗ │
│ ┃TGMapManager       ┃─ ─ ─Implements ─ ▶║TGCompatibleMapManager  ║ │
│ ┗━━━━━━━━━━━━━━━━━━━┛                   ╚════════════════════════╝ │
└───────────▲────────────────────────────────────────────────────────┘
            │
        Subclass──────────────────┐
            │                     │
┌───────────┼─────────────────────┼──────────────────────────────────┐
│ TripKitUI │                     │                                  │
│ ┏━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━┓                        │
│ ┃TKUIMapManager     ┃ ┃TKUIComposingMap...┃                        │
│ ┗━━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━━┛                        │
│           ▲                                                        │
│       Subclass──────────────────┬─────────────────────┐            │
│           │                     │                     │            │
│ ┏━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━┓  │
│ ┃TKUIServiceMapMa...┃ ┃TKUIRoutingResul...┃ ┃TKUITripMapManager ┃  │
│ ┗━━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━━┛  │
└────────────────────────────────────────────────────────────────────┘
  • A factory that all map managers will use as for the default annotations.

    @default: TKUIAnnotationViewBuilder

    Declaration

    Swift

    public static var annotationBuilderFactory: ((MKAnnotation, MKMapView) -> TKUIAnnotationViewBuilder)
  • Callback that fires when attributions need to be displayed. In particular when using tiles.

    Declaration

    Swift

    public var attributionDisplayer: (([TKAPI.DataAttribution], _ sender: UIView) -> Void)?
  • Whether to show the coverage polygon which greys out areas outside the coverage

    Declaration

    Swift

    open var showOverlayPolygon: Bool
  • The identifier for what should be drawn as selected on the map

    Declaration

    Swift

    public var selectionIdentifier: String? { get set }
  • Declaration

    Swift

    public var selectionMode: TKUIPolylineRenderer.SelectionMode
  • Declaration

    Swift

    public var overlays: [MKOverlay] { get set }
  • Annotation that should be animated in and out when appearing and disappearing. Also, when updating this array, only the differnces will be animated for any annotations conforming to TKUIIdentifiableAnnotation

    Declaration

    Swift

    public var animatedAnnotations: [MKAnnotation] { get set }
  • Annotations where each annotation can dynamically change, e.g., changing its coordinate, title/subtitle, and preferred alpha

    Declaration

    Swift

    public var dynamicAnnotations: [MKAnnotation] { get set }
  • Declaration

    Swift

    override open func takeCharge(of mapView: MKMapView, edgePadding: UIEdgeInsets, animated: Bool)
  • Declaration

    Swift

    override open func reactToNewEdgePadding(_ edgePadding: UIEdgeInsets)
  • Declaration

    Swift

    override open func cleanUp(_ mapView: MKMapView, animated: Bool)
  • Declaration

    Swift

    open func annotationBuilder(for annotation: MKAnnotation, in mapView: MKMapView) -> TKUIAnnotationViewBuilder

Updating dynamic annotations

  • Call this to trigger an update of dynamic annotations, such as real-time vehicles.

    Declaration

    Swift

    @objc
    open func updateDynamicAnnotations(animated: Bool = false)

MKMapViewDelegate

  • Declaration

    Swift

    open func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView])
  • Declaration

    Swift

    open func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView?
  • Declaration

    Swift

    open func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer
  • Declaration

    Swift

    open func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool)
  • Declaration

    Swift

    open func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView)