Functions
The following functions are available globally.
-
Calculates the bearing between two coordinates
Declaration
Swift
func calculateBearing(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D) -> DoubleParameters
fromCLLocationCoordinate2DtoCLLocationCoordinate2DReturn Value
The bearing between the two input coordinates
-
Checks if the vsign entering direction (determined using the bearing) matches with the one required by the vSign, including a tolerance threshold
Declaration
Swift
func checkBearing(signalBearing: Double, currBearing: Double, tolerance: Int) -> BoolParameters
signalBearingEntering bearing associate to the vSign
currBearingBearing of the user entering the vSign
toleranceValue (in degreees) used as the tolerance threshold.
Return Value
Returns true or false if the user entering bearing matches with the bearing assigned to the vSign
-
findMatchingSignals(signals:currLocation: currBearing: tolerance: enableBearingChecks: notifiedTimeoutSeconds: ) Given a list of vSigns, find the entered and the matched ones, based on the input location
Declaration
Swift
func findMatchingSignals(signals: [QPSignal], currLocation: CLLocation, currBearing: Double, tolerance: Int, enableBearingChecks: Bool = true, notifiedTimeoutSeconds: Int = 60 * 5 ) -> VSignScanResults -
Helper function to convert degrees to radians
Declaration
Swift
func deg2rad(_ number: Double) -> Double -
Helper function to convert radians to degrees
Declaration
Swift
func rad2deg(_ number: Double) -> Double
Functions Reference