MapViewDelegate

public protocol MapViewDelegate : AnyObject

The MapViewDelegate will receive events and messages from the MapView.

  • When a user taps on the MapView and one or more Polygon models are below it, this function will be called.

    Note: This API is called before the other tapped delegate functions, and does not take into account event routing.

    Declaration

    Swift

    func tappedPolygons(polygons: [Polygon])

    Parameters

    polygons

    A list of polygons that are under the tap point

  • When a user taps on the MapView and one or more Polygon models are below it, this function will be called for each polygon.

    Note: The tapped api always sends the event to the object that closerst (ontop) of the camera view first.

    Declaration

    Swift

    func tapped(_ mapView: MapView, polygon: Polygon) -> Bool

    Parameters

    mapView

    which mapview the user tapped on

    polygon

    A polygon that was tapped

    Return Value

    if the delegate accepted he tapped event, returning true will stop the MapView from searching for any other element which could have been tapped and calling a delegate function for them.

  • When a user taps on the MapView and one or more Element models are below it, this function will be called for each Element

    Note: The tapped api always sends the event to the object that closerst (ontop) of the camera view first.

    Declaration

    Swift

    func tapped(_ mapView: MapView, element: Element) -> Bool

    Parameters

    mapView

    which mapview the user tapped on

    element

    A Element that was tapped

    Return Value

    if the delegate accepted he tapped event, returning true will stop the MapView from searching for any other element which could have been tapped and calling a delegate function for them.

  • When a user taps on the MapView and the tap hits the map, this function will be called to provide the Core Location Coordinate associated with the position that was tapped. This might be useful for generating coordinates for a GPX file to simulate user location.

    Declaration

    Swift

    func tapped(_ mapView: MapView, clCoordinate: CLLocationCoordinate2D)

    Parameters

    mapView

    which mapview the user tapped on

    element

    the Core Location Coordinate that was tapped

  • When a user moves the camera on the MapView, this function will be called.

    Declaration

    Swift

    func manipulatedCamera()