GLRouteElevation

Objective-C


@interface GLRouteElevation : NSObject

Swift

class GLRouteElevation : NSObject

GLRouteElevation is a class that loads and models height data for a route.

  • Requests the height profile for the specified points.

    Declaration

    Objective-C

    + (int64_t)requestHeightWithPoints:(GLMapGeoPoint *_Nonnull)points
                                 count:(NSUInteger)count
                       completionBlock:
                           (GLMapHeightDataCompletionBlock _Nonnull)completionBlock;

    Swift

    class func requestHeight(withPoints points: UnsafeMutablePointer<GLMapGeoPoint>, count: UInt, completionBlock: @escaping GLMapHeightDataCompletionBlock) -> Int64

    Parameters

    points

    An array of points in geographic coordinates (GLMapGeoPoint, WGS‑84).

    count

    Number of points in the array.

    completionBlock

    A block called when the request finishes (successfully or with an error).

  • Requests the height profile for the points in the specified route.

    Declaration

    Objective-C

    + (int64_t)requestHeightForRoute:(GLRoute *_Nonnull)route
                     completionBlock:
                         (GLMapHeightDataCompletionBlock _Nullable)completionBlock;

    Swift

    class func requestHeight(for route: GLRoute, completionBlock: GLMapHeightDataCompletionBlock? = nil) -> Int64

    Parameters

    route

    Route to update with height information.

    completionBlock

    A block called when the request finishes (successfully or with an error). May be nil.

  • Requests the height profile for the points in the specified route using offline data.

    Declaration

    Objective-C

    + (int64_t)requestOfflineHeightForRoute:(GLRoute *_Nonnull)route
                               allowPartial:(BOOL)allowPartial
                            completionBlock:
                                (GLMapHeightDataCompletionBlock _Nullable)
                                    completionBlock;

    Swift

    class func requestOfflineHeight(for route: GLRoute, allowPartial: Bool, completionBlock: GLMapHeightDataCompletionBlock? = nil) -> Int64

    Parameters

    route

    Route to update with height information.

    allowPartial

    If NO, the request fails if any required elevation tile is missing.

    completionBlock

    A block called when the request finishes (successfully or with an error). May be nil.

  • Cancels a previously started request.

    Declaration

    Objective-C

    + (void)cancelRequest:(int64_t)requestID;

    Swift

    class func cancel(_ requestID: Int64)

    Parameters

    requestID

    Request ID returned from a request… method.

  • min

    Minimum elevation value, in meters.

    Declaration

    Objective-C

    @property (readonly) double min;

    Swift

    var min: Double { get }
  • max

    Maximum elevation value, in meters.

    Declaration

    Objective-C

    @property (readonly) double max;

    Swift

    var max: Double { get }
  • Returns the elevation at a given point index.

    Declaration

    Objective-C

    - (double)heightAtIndex:(uint32_t)index;

    Swift

    func height(at index: UInt32) -> Double

    Parameters

    index

    Point index in the elevation profile.

    Return Value

    Elevation in meters.