ZoomExtentButton
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
: aMKMapView
to 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.ZoomExtentButton
with a frame of zero.Declaration
Swift
required public init()
-
A convenience initializer that instantiates a
FUIMapToolbar.ZoomExtentButton
Declaration
Swift
public convenience init(mapView: MKMapView)
Parameters
mapView
A MKMapView type
-
The map view which zoom extent button is attached to.
Declaration
Swift
public weak var mapView: MKMapView?