GLMapVectorLine

Objective-C


@interface GLMapVectorLine : GLMapVectorObject

Swift

class GLMapVectorLine : GLMapVectorObject

GLMapVectorLine is a bridge class to work with GLMap’s internal representation of single and multiple lines.

  • Line geometries for this object (one GLMapPointArray per polyline).

    Declaration

    Objective-C

    @property (readonly) NSArray<GLMapPointArray *> *_Nonnull lines;

    Swift

    var lines: [GLMapPointArray] { get }
  • Creates a vector object with a line.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithLine:(nonnull GLMapPointArray *)line;

    Swift

    init(line: GLMapPointArray)

    Parameters

    line

    The line.

  • Creates a vector object with multiple lines.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithLines:
        (nonnull NSArray<GLMapPointArray *> *)lines;

    Swift

    init(lines: [GLMapPointArray])

    Parameters

    lines

    The lines.

  • Creates vector object with a great-circle line from start to end. Useful for displaying plane routes.

    Declaration

    Objective-C

    - (nonnull instancetype)initGeoStart:(GLMapGeoPoint)start
                                     end:(GLMapGeoPoint)end
                                 quality:(double)quality;

    Swift

    init(geoStart start: GLMapGeoPoint, end: GLMapGeoPoint, quality: Double)

    Parameters

    start

    Start point.

    end

    End point.

    quality

    Maximum distance from the point to the line, used for simplification in the Douglas Peucker algorithm. Units are map internal coordinates.

  • Finds a point at a distance from the start.

    Declaration

    Objective-C

    - (GLMapPoint)pointAtLineDistance:(double)distance;

    Swift

    func point(atLineDistance distance: Double) -> GLMapPoint

    Parameters

    distance

    Distance in meters.

    Return Value

    Point on the line that is located at the given distance.

  • Finds nearest point of object to given point and returns line distance to it

    Declaration

    Objective-C

    - (double)lineDistanceToPoint:(GLMapPoint)point
                     nearestPoint:(nonnull GLMapPoint *)nearestPoint
                      maxDistance:(double)maxDistance;

    Swift

    func lineDistance(to point: GLMapPoint, nearestPoint: UnsafeMutablePointer<GLMapPoint>, maxDistance: Double) -> Double

    Parameters

    point

    Point to test

    nearestPoint

    nearest point on line

    maxDistance

    max distance from line in internal map units

    Return Value

    distance from line start to nearest point in meters, or NAN