Functions

The following functions are available globally.

Public Functions

  • This function encodes an [CLLocationCoordinate2D] to a String

    Declaration

    Swift

    public func encodeCoordinates(_ coordinates: [CLLocationCoordinate2D], precision: Double = 1e5) -> String

    Parameters

    coordinates

    The Array of CLLocationCoordinate2D that you want to encode

    precision

    The precision used to encode coordinates (default: 1e5)

    Return Value

    A String representing the encoded Polyline

  • This function encodes an [CLLocation] to a String

    Declaration

    Swift

    public func encodeLocations(_ locations: [CLLocation], precision: Double = 1e5) -> String

    Parameters

    coordinates

    The Array of CLLocation that you want to encode

    precision

    The precision used to encode locations (default: 1e5)

    Return Value

    A String representing the encoded Polyline

  • This function encodes an [UInt32] to a String

    Declaration

    Swift

    public func encodeLevels(_ levels: [UInt32]) -> String

    Parameters

    levels

    The Array of UInt32 levels that you want to encode

    Return Value

    A String representing the encoded Levels

  • This function decodes a String to a [CLLocationCoordinate2D]?

    Declaration

    Swift

    public func decodePolyline(_ encodedPolyline: String, precision: Double = 1e5) -> [CLLocationCoordinate2D]?

    Parameters

    encodedPolyline

    String representing the encoded Polyline

    precision

    The precision used to decode coordinates (default: 1e5)

    Return Value

    A [CLLocationCoordinate2D] representing the decoded polyline if valid, nil otherwise

  • This function decodes a String to a [CLLocation]?

    Declaration

    Swift

    public func decodePolyline(_ encodedPolyline: String, precision: Double = 1e5) -> [CLLocation]?

    Parameters

    encodedPolyline

    String representing the encoded Polyline

    precision

    The precision used to decode locations (default: 1e5)

    Return Value

    A [CLLocation] representing the decoded polyline if valid, nil otherwise

  • This function decodes a String to an [UInt32]

    Declaration

    Swift

    public func decodeLevels(_ encodedLevels: String) -> [UInt32]?

    Parameters

    encodedLevels

    The String representing the levels to decode

    Return Value

    A [UInt32] representing the decoded Levels if the String is valid, nil otherwise