GLMapVectorLine

Objective-C


@interface GLMapVectorLine : GLMapVectorObject

Swift

class GLMapVectorLine : GLMapVectorObject

GLMapVectorLine is a bridge class, to work with GLMap internal representation of line and multiline.

  • Data previously loaded by -[GLMapVectorObject initWithMultiline:].

    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 multiline.

  • Creates vector object with a big 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.

  • Find point at distance form start

    Declaration

    Objective-C

    - (GLMapPoint)pointAtLineDistance:(double)distance;

    Swift

    func point(atLineDistance distance: Double) -> GLMapPoint

    Parameters

    distance

    distance in meters

    Return Value

    point on line that is located at 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 projected units

    Return Value

    line distance to point or NAN