ZoomExtentButton
@MainActor
open class ZoomExtentButton : FUIMapToolbarButton
FUIMapToolbar.ZoomExtentButton inherits from the FUIButton class and is presented within the FUIMapToolbar. This button zooms accordingly to show all annotations in the mapView.
Available in FUIMapToolbar.ZoomExtentButton:
mapView: aMKMapViewto zoom and show all annotations
Usage:
let point1 = MKPointAnnotation()
point1.coordinate = CLLocationCoordinate2D(latitude: 37.3318, longitude: -122.0312)
let point2 = MKPointAnnotation()
point2.coordinate = CLLocationCoordinate2D(latitude: 37.3988313, longitude: -122.1487375)
let annotations = [point1, point2]
mapView.addAnnotations(annotations)
let toolbar = FUIMapToolbar(mapView: mapView)
let locationButton = FUIMapToolbar.ZoomExtentButton(mapView: self.mapView)
toolbar.items = [locationButton]
-
A initializer that instantiates a
FUIMapToolbar.ZoomExtentButtonwith a frame of zero.Declaration
Swift
@MainActor required public init() -
A convenience initializer that instantiates a
FUIMapToolbar.ZoomExtentButtonDeclaration
Swift
@MainActor public convenience init(mapView: MKMapView)Parameters
mapViewA MKMapView type
-
The map view which zoom extent button is attached to.
Declaration
Swift
@MainActor public weak var mapView: MKMapView?