Skip to content

Commit

Permalink
Added convenience initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenTiigi committed Nov 29, 2022
1 parent 9a3bbff commit 6db95b1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Sources/FlyoverMap/FlyoverMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,40 @@ public struct FlyoverMap {

}

// MARK: - Convenience Initializer

public extension FlyoverMap {

/// Creates a new instance of `FlyoverMap`
/// - Parameters:
/// - isStarted: Bool value if Flyover is started. Default value `true`
/// - latitude: The latitude.
/// - longitude: The longitude.
/// - configuration: The Flyover Configuration. Default value `.default`
/// - mapView: The MapType. Default value `.standard`
/// - updateMapView: A closure to update the underlying FlyoverMapView. Default value `nil`
init(
isStarted: Bool = true,
latitude: CLLocationDegrees,
longitude: CLLocationDegrees,
configuration: Flyover.Configuration = .default,
mapType: MKMapType = .standard,
updateMapView: ((FlyoverMapView) -> Void)? = nil
) {
self.init(
isStarted: isStarted,
coordinate: .init(
latitude: latitude,
longitude: longitude
),
configuration: configuration,
mapType: mapType,
updateMapView: updateMapView
)
}

}

// MARK: - UIViewRepresentable

extension FlyoverMap: UIViewRepresentable {
Expand Down

0 comments on commit 6db95b1

Please sign in to comment.