FUIMKMapView

open class FUIMKMapView : MKMapView

A subclass of MKMapView is designed to be used with MapKit framework. You can use FUIMKMapView to display map information and to manipulate the map contents from your application. The FUIMKMapView class supports the ability to cache common map interface objects: annotations and overlays. Native MKMapView API methods are also available for developer use. It also adds the selection and deselection handlers for overlays.

Usage

When configuring your map interface with FUIMKMapView, all the added annotation and overlay objects and their corresponding display objects will be cached internally. Add annotation objects to the map view

func addAnnotation(_ annotation: MKAnnotation, toLayer layer: FUIGeometryLayer) {}
func addAnnotation(_ annotation: MKAnnotation, geometryLayer layer: FUIGeometryLayer) {}
func addAnnotations(_ annotations: [MKAnnotation], geometryLayer layer: FUIGeometryLayer) {}

Add overlay objects to the map view

func addOverlays(_ overlays: [MKOverlay], level: MKOverlayLevel, geometryLayer layer: FUIGeometryLayer) {}
func addOverlays(_ overlays: [MKOverlay], geometryLayer layer: FUIGeometryLayer) {}

Respond to select/deselect overlay action

func selectOverlay(_ overlay: MKOverlay, animated: Bool) {}
func deselectOverlay(_ overlay: MKOverlay, animated: Bool) {}

Theming

  • The delegate handler of FUIMKMapView.

    Declaration

    Swift

    override weak open var delegate: MKMapViewDelegate? { get set }
  • Geometry layers in the map view.

    Declaration

    Swift

    open internal(set) var layers: [FUIGeometryLayer] { get }
  • Overlays for layers in the map view.

    Declaration

    Swift

    open internal(set) var overlaysForLayer: [FUIGeometryLayer : [FUIOverlay]] { get }
  • Annotations for layers in the map view.

    Declaration

    Swift

    open internal(set) var annotationsForLayer: [FUIGeometryLayer : [FUIAnnotation]] { get }
  • Visibility of layers in the map view.

    Declaration

    Swift

    open internal(set) var isLayerHidden: [FUIGeometryLayer : Bool] { get }
  • Selected overlays in the map view.

    Declaration

    Swift

    open internal(set) var selectedOverlays: [FUIOverlay] { get }
  • Highlight an overlay to its selected display status.

    Declaration

    Swift

    open func selectOverlay(_ overlay: FUIOverlay, animated: Bool)

    Parameters

    overlay

    the overlay object to select

    animated

    if YES, the view is highlighted with animation.

  • Restore a selected overlay to its default display status.

    Declaration

    Swift

    open func deselectOverlay(_ overlay: FUIOverlay, animated: Bool)

    Parameters

    overlay

    the overlay object to deselect

    animated

    if YES, the view returns to normal state with animation.