Functions

The following functions are available globally.

  • Blend colors with overlay function

    Declaration

    Objective-C

    GLMapColor BlendColorsOverlay(GLMapColor tint, GLMapColor color)

    Swift

    func blendOverlay(color: GLMapColor) -> GLMapColor

    Parameters

    tint

    tint color

    color

    color to blend

  • Creates new color from int chanel values 0 - 255

    Declaration

    Objective-C

    static inline GLMapColor GLMapColorMake(uint8_t r, uint8_t g, uint8_t b,
                                            uint8_t a)

    Swift

    /*not inherited*/ init(red r: UInt8, green g: UInt8, blue b: UInt8, alpha a: UInt8)

    Parameters

    r

    Red channel value

    g

    Green channel value

    b

    Blue channel value

    a

    Alpha channel value

    Return Value

    Returns new color object

  • Declaration

    Objective-C

    static inline uint8_t GLMapColorGetRed(GLMapColor color)

    Swift

    var red: UInt8 { get set }

    Parameters

    color

    Input color

    Return Value

    Returns red channel value

  • Declaration

    Objective-C

    static inline uint8_t GLMapColorGetGreen(GLMapColor color)

    Swift

    var green: UInt8 { get set }

    Parameters

    color

    Input color

    Return Value

    Returns green channel value

  • Declaration

    Objective-C

    static inline uint8_t GLMapColorGetBlue(GLMapColor color)

    Swift

    var blue: UInt8 { get set }

    Parameters

    color

    Input color

    Return Value

    Returns blue channel value

  • Declaration

    Objective-C

    static inline uint8_t GLMapColorGetAlpha(GLMapColor color)

    Swift

    var alpha: UInt8 { get set }

    Parameters

    color

    Input color

    Return Value

    Returns alpha channel value

  • Declaration

    Objective-C

    static inline void GLMapColorSetRed(GLMapColor *_Nonnull color, uint8_t value)

    Parameters

    color

    Input color

    value

    new red value

  • Declaration

    Objective-C

    static inline void GLMapColorSetGreen(GLMapColor *_Nonnull color, uint8_t value)

    Parameters

    color

    Input color

    value

    new green value

  • Declaration

    Objective-C

    static inline void GLMapColorSetBlue(GLMapColor *_Nonnull color, uint8_t value)

    Parameters

    color

    Input color

    value

    new blue value

  • Declaration

    Objective-C

    static inline void GLMapColorSetAlpha(GLMapColor *_Nonnull color, uint8_t value)

    Parameters

    color

    Input color

    value

    new alpha value

  • Creates new color from float chanel values 0.0 - 1.0

    Declaration

    Objective-C

    static inline GLMapColor GLMapColorMakeF(float r, float g, float b, float a)

    Swift

    func GLMapColorMakeF(_ r: Float, _ g: Float, _ b: Float, _ a: Float) -> GLMapColor

    Parameters

    r

    Red channel value

    g

    Green channel value

    b

    Blue channel value

    a

    Alpha channel value

    Return Value

    Returns new color object

  • Declaration

    Objective-C

    static inline float GLMapColorGetRedF(GLMapColor color)

    Swift

    var redF: Float { get }

    Parameters

    color

    Input color

    Return Value

    Returns red channel value

  • Declaration

    Objective-C

    static inline float GLMapColorGetGreenF(GLMapColor color)

    Swift

    var greenF: Float { get }

    Parameters

    color

    Input color

    Return Value

    Returns green channel value

  • Declaration

    Objective-C

    static inline float GLMapColorGetBlueF(GLMapColor color)

    Swift

    var blueF: Float { get }

    Parameters

    color

    Input color

    Return Value

    Returns blue channel value

  • Declaration

    Objective-C

    static inline float GLMapColorGetAlphaF(GLMapColor color)

    Swift

    var alphaF: Float { get }

    Parameters

    color

    Input color

    Return Value

    Returns alpha channel value

  • Creates CGColor object from our GLMapColor

    Declaration

    Objective-C

    struct CGColor *_Nullable CGColorFromGLMapColor(GLMapColor color)

    Swift

    func CGColorFromGLMapColor(_ color: GLMapColor) -> OpaquePointer?

    Parameters

    color

    Initial color

    Return Value

    New CGColor object

  • Checks if it’s error or success code

    Declaration

    Objective-C

    static inline _Bool GLMapIsSuccess(GLMapError v)

    Swift

    var isSuccess: Bool { get }
  • Creates GLMapTilePos

    Declaration

    Objective-C

    static inline GLMapTilePos GLMapTilePosMake(int x, int y, int z)

    Swift

    /*not inherited*/ init(x: Int32, y: Int32, z: Int32)

    Parameters

    x

    X coordinate

    y

    Y coordinate

    z

    Z coordinate

    Return Value

    New tile position

  • Creates NSColor object from our GLMapColor

    Declaration

    Objective-C

    NSColor *_Nullable NSColorFromGLMapColor(GLMapColor color)

    Swift

    var nsColor: NSColor? { get }

    Parameters

    color

    Initial color

    Return Value

    New NSColor object

  • Converts NSData objects into GLMapResources.

    Declaration

    Objective-C

    GLMapResource GLMapResourceWithData(NSData *_Nonnull data)

    Swift

    /*not inherited*/ init(data: Data)

    Parameters

    data

    Data object to convert.

    Return Value

    Created resource object.

  • Creates route point

    Declaration

    Objective-C

    static inline GLRoutePoint GLRoutePointMake(GLMapGeoPoint pt, double heading,
                                                _Bool isStop, _Bool allowUTurn)

    Swift

    /*not inherited*/ init(pt: GLMapGeoPoint, heading: Double, isStop: Bool, allowUTurn: Bool)
  • Adds point into existing bounding box.

    Declaration

    Objective-C

    static inline GLMapBBox GLMapBBoxAddPoint(GLMapBBox bbox, GLMapPoint point)

    Swift

    func adding(_ point: GLMapPoint) -> GLMapBBox

    Parameters

    bbox

    Bounding box

    point

    Point to add into bounding box

  • Adds a point into an existing bounding box, ensuring correct handling when points are on both sides of the 180th meridian.

    Declaration

    Objective-C

    static inline GLMapBBox GLMapBBoxSafeAddPoint(GLMapBBox bbox, GLMapPoint point)

    Swift

    func safeAdding(_ point: GLMapPoint) -> GLMapBBox

    Parameters

    bbox

    The bounding box to which the point will be added.

    point

    The point to add into the bounding box.

    Return Value

    The updated bounding box after adding the point.

  • Checks if the bbox contains the point

    Declaration

    Objective-C

    static inline _Bool GLMapBBoxContains(GLMapBBox bbox, GLMapPoint point)

    Swift

    func contains(_ point: GLMapPoint) -> Bool

    Parameters

    bbox

    Bounding box

    point

    Point to check

    Return Value

    true if point is in bbox

  • Creates new bounding box

    Declaration

    Objective-C

    static inline GLMapBBox GLMapBBoxMake(GLMapPoint origin, double width,
                                          double height)

    Swift

    /*not inherited*/ init(origin: GLMapPoint, width: Double, height: Double)

    Parameters

    origin

    Origin point

    width

    Width

    height

    Height

    Return Value

    New bounding box

  • Checks equality of two bounding boxes

    Declaration

    Objective-C

    static inline _Bool GLMapBBoxEqual(GLMapBBox a, GLMapBBox b)

    Swift

    func GLMapBBoxEqual(_ a: GLMapBBox, _ b: GLMapBBox) -> Bool

    Parameters

    a

    First bounding box

    b

    Second bounding box

    Return Value

    true if bounding boxes is equal

  • Returns center of bbox

    Declaration

    Objective-C

    static inline GLMapPoint GLMapBBoxCenter(GLMapBBox a)

    Swift

    var center: GLMapPoint { get }

    Return Value

    center of bbox

  • Rotates an existing bounding box around its center by a given angle.

    Declaration

    Objective-C

    static inline GLMapBBox GLMapBBoxRotating(GLMapBBox bbox, double angle)

    Swift

    func rotating(angle: Double) -> GLMapBBox

    Parameters

    bbox

    The bounding box to be rotated

    angle

    The angle in degrees by which the bounding box should be rotated

    Return Value

    The rotated bounding box

  • Computes distance from bounding box to point

    Declaration

    Objective-C

    double GLMapBBoxDistanceToPoint(GLMapBBox bbox, GLMapPoint point)

    Swift

    func distanceTo(_ point: GLMapPoint) -> Double

    Parameters

    bbox

    Bounding box

    point

    Point

    Return Value

    Distance in internal coordinates

  • Checks if two bbox have any common point

    Declaration

    Objective-C

    static inline _Bool GLMapBBoxIntersects(GLMapBBox a, GLMapBBox b)

    Swift

    func intersects(bbox b: GLMapBBox) -> Bool

    Parameters

    a

    First bounding bbox

    b

    Second bounding bbox

    Return Value

    true if bbox intersecs other bbox

  • Creates map point from geo coordinates

    Declaration

    Objective-C

    GLMapPoint GLMapPointMakeFromGeoCoordinates(double lat, double lon)

    Swift

    /*not inherited*/ init(lat: Double, lon: Double)

    Parameters

    lat

    Latitude

    lon

    Longitude

    Return Value

    New map point

  • Creates map point from geo point

    Declaration

    Objective-C

    GLMapPoint GLMapPointFromMapGeoPoint(GLMapGeoPoint point)

    Swift

    /*not inherited*/ init(geoPoint point: GLMapGeoPoint)

    Parameters

    point

    Geo point

    Return Value

    New point

  • Creates map point from tile position

    Declaration

    Objective-C

    GLMapPoint GLMapPointFromMapTilePos(GLMapTilePos tilePos)

    Swift

    /*not inherited*/ init(tilePos: GLMapTilePos)

    Parameters

    tilePos

    Tile position

    Return Value

    New point

  • Creates geo point from map coordinates

    Declaration

    Objective-C

    GLMapGeoPoint GLMapGeoPointFromMapPoint(GLMapPoint point)

    Swift

    /*not inherited*/ init(point: GLMapPoint)

    Parameters

    point

    Map point

    Return Value

    New geo point

  • Calculates distance between two points on map

    Declaration

    Objective-C

    double GLMapDistanceBetweenPoints(GLMapPoint a, GLMapPoint b)

    Swift

    func distanceTo(_ b: GLMapPoint) -> Double

    Parameters

    a

    First point on map

    b

    Second point on map

    Return Value

    Distance in meters

  • Calculates bearing between two geo points.

    Declaration

    Objective-C

    double GLMapBearingBetweenPoints(GLMapPoint a, GLMapPoint b)

    Swift

    func bearingTo(_ b: GLMapPoint) -> Double

    Parameters

    a

    First point

    b

    Second point

    Return Value

    bearing angle in degrees

  • Creates new empty set

    Declaration

    Objective-C

    GLMapPointSet _Nonnull GLMapPointSetCreate(void)

    Swift

    func GLMapPointSetCreate() -> GLMapPointSet
  • Destroys set

    Declaration

    Objective-C

    void GLMapPointSetDestroy(GLMapPointSet _Nonnull set)

    Swift

    func GLMapPointSetDestroy(_ set: GLMapPointSet)

    Parameters

    set

    set to destroy

  • Adds new point to set. Can add many points with same coordinates.

    Declaration

    Objective-C

    void GLMapPointSetInsert(GLMapPointSet _Nonnull set, GLMapPoint point)

    Swift

    func GLMapPointSetInsert(_ set: GLMapPointSet, _ point: GLMapPoint)

    Parameters

    set

    set to modify

    point

    point to add

  • Inserts new point to set.

    Declaration

    Objective-C

    _Bool GLMapPointSetInsertUnique(GLMapPointSet _Nonnull set, GLMapPoint point)

    Swift

    func GLMapPointSetInsertUnique(_ set: GLMapPointSet, _ point: GLMapPoint) -> Bool

    Parameters

    set

    set to modify

    point

    point to insert.

    Return Value

    true if point is inserted. false if point with same coordinates already in set.

  • Removes point from set

    Declaration

    Objective-C

    _Bool GLMapPointSetRemove(GLMapPointSet _Nonnull set, GLMapPoint point)

    Swift

    func GLMapPointSetRemove(_ set: GLMapPointSet, _ point: GLMapPoint) -> Bool

    Parameters

    set

    set to modify

    point

    point to remove

    Return Value

    YES if point was removed

  • Checks if set have given point

    Declaration

    Objective-C

    _Bool GLMapPointSetContains(GLMapPointSet _Nonnull set, GLMapPoint point)

    Swift

    func GLMapPointSetContains(_ set: GLMapPointSet, _ point: GLMapPoint) -> Bool

    Parameters

    set

    set to test

    point

    point to test

    Return Value

    YES if point is in set

  • Returns nearest point in set

    Declaration

    Objective-C

    GLMapPoint GLMapPointSetNearestPoint(GLMapPointSet _Nonnull set,
                                         GLMapPoint point)

    Swift

    func GLMapPointSetNearestPoint(_ set: GLMapPointSet, _ point: GLMapPoint) -> GLMapPoint

    Parameters

    set

    object created by GLMapPointSetCreate

    point

    reference point to calculate distance

    Return Value

    Nearest point in set

  • Creates new empty set

    Declaration

    Objective-C

    GLMapBBoxSet _Nonnull GLMapBBoxSetCreate(void)

    Swift

    func GLMapBBoxSetCreate() -> GLMapBBoxSet
  • Destroys set

    Declaration

    Objective-C

    void GLMapBBoxSetDestroy(GLMapBBoxSet _Nonnull set)

    Swift

    func GLMapBBoxSetDestroy(_ set: GLMapBBoxSet)

    Parameters

    set

    set to destroy

  • Test if bbox intersects with any other bbox in set.

    Declaration

    Objective-C

    _Bool GLMapBBoxSetTest(GLMapBBoxSet _Nonnull set, GLMapBBox bbox)

    Swift

    func GLMapBBoxSetTest(_ set: GLMapBBoxSet, _ bbox: GLMapBBox) -> Bool

    Parameters

    set

    set

    bbox

    bbox to test

    Return Value

    true if intersects

  • Adds new bbox to set.

    Declaration

    Objective-C

    void GLMapBBoxSetInsert(GLMapBBoxSet _Nonnull set, GLMapBBox bbox)

    Swift

    func GLMapBBoxSetInsert(_ set: GLMapBBoxSet, _ bbox: GLMapBBox)

    Parameters

    set

    set to modify

    bbox

    bbox to add

  • Parse double using fast_float.

    Declaration

    Objective-C

    _Bool ParseDouble(const char *_Nonnull *_Nonnull string, uint32_t length,
                      double *_Nonnull result)

    Swift

    func ParseDouble(_ string: UnsafeMutablePointer<UnsafePointer<CChar>>, _ length: UInt32, _ result: UnsafeMutablePointer<Double>) -> Bool

    Parameters

    string

    on input - string to parse, on outpur last position wehre parsing stops

    length

    length of string

    result

    on output - result of parse

    Return Value

    true if success

  • Parse float using fast_float.

    Declaration

    Objective-C

    _Bool ParseFloat(const char *_Nonnull *_Nonnull string, uint32_t length,
                     float *_Nonnull result)

    Swift

    func ParseFloat(_ string: UnsafeMutablePointer<UnsafePointer<CChar>>, _ length: UInt32, _ result: UnsafeMutablePointer<Float>) -> Bool

    Parameters

    string

    on input - string to parse, on outpur last position wehre parsing stops

    length

    length of string

    result

    on output - result of parse

    Return Value

    true if success

  • Creates new GLMapGeoPoint.

    Declaration

    Objective-C

    static inline GLMapGeoPoint GLMapGeoPointMake(double lat, double lon)

    Swift

    /*not inherited*/ init(lat: Double, lon: Double)

    Parameters

    lat

    Latitude

    lon

    Longitude

    Return Value

    New geo point

  • Checks equality of two geo points

    Declaration

    Objective-C

    static inline _Bool GLMapGeoPointEqual(GLMapGeoPoint a, GLMapGeoPoint b)

    Swift

    func GLMapGeoPointEqual(_ a: GLMapGeoPoint, _ b: GLMapGeoPoint) -> Bool

    Parameters

    a

    First geo point

    b

    Second geo point

    Return Value

    true if map points is equal

  • Calculates distance between two points. Сontains internal conversion to GLMapGeoPoint.

    Declaration

    Objective-C

    double GLMapDistanceBetweenGeoPoints(GLMapGeoPoint a, GLMapGeoPoint b)

    Swift

    func distanceTo(_ b: GLMapGeoPoint) -> Double

    Parameters

    a

    First geo point

    b

    Second geo point

    Return Value

    Distance in meters

  • Calculates bearing between two points. Сontains internal conversion to GLMapGeoPoint.

    Declaration

    Objective-C

    double GLMapBearingBetweenGeoPoints(GLMapGeoPoint a, GLMapGeoPoint b)

    Swift

    func bearingTo(_ b: GLMapGeoPoint) -> Double

    Parameters

    a

    First geo point

    b

    Second geo point

    Return Value

    bearing angle in degrees

  • Print message to the stdout.

    Declaration

    Objective-C

    static inline void SendLogMessage(const char *name, ...)
  • Changes map marker style

    Declaration

    Objective-C

    void GLMapMarkerSetStyle(GLMapMarkerData _Nonnull data, uint32_t style)

    Swift

    func GLMapMarkerSetStyle(_ data: GLMapMarkerData, _ style: UInt32)

    Parameters

    data

    Marker object to be changed

    style

    Style identifier

  • Sets text for map marker.

    Declaration

    Objective-C

    void GLMapMarkerSetText(GLMapMarkerData _Nonnull data,
                            GLMapTextAlignment textAlignment,
                            NSString *_Nonnull text, CGPoint offset,
                            GLMapVectorStyle *_Nonnull style)

    Swift

    func GLMapMarkerSetText(_ data: GLMapMarkerData, _ textAlignment: GLMapTextAlignment, _ text: String, _ offset: CGPoint, _ style: GLMapVectorStyle)

    Parameters

    data

    Marker object to be changed

    textAlignment

    alignment of text. If it is Undefined- alignment will be calculated from offset.

    text

    Text for marker object

    offset

    Offset of the text center relative to the marker center

    style

    Text style

  • Creates new GLMapPoint

    Declaration

    Objective-C

    static inline GLMapPoint GLMapPointMake(double x, double y)

    Swift

    /*not inherited*/ init(x: Double, y: Double)

    Parameters

    x

    X coordinate

    y

    Y coordinate

    Return Value

    New map point

  • Checks equality of two map points

    Declaration

    Objective-C

    static inline _Bool GLMapPointEqual(GLMapPoint a, GLMapPoint b)

    Swift

    func GLMapPointEqual(_ a: GLMapPoint, _ b: GLMapPoint) -> Bool

    Parameters

    a

    First map point

    b

    Second map point

    Return Value

    true if map points is equal

  • Return sum of point components

    Declaration

    Objective-C

    static inline GLMapPoint GLMapPointAdd(GLMapPoint point, double x, double y)

    Swift

    func add(x: Double, y: Double) -> GLMapPoint

    Parameters

    point

    point

    x

    x component

    y

    y component

    Return Value

    Sum of components

  • Length between two points

    Declaration

    Objective-C

    double GLMapPointLength(GLMapPoint a, GLMapPoint b)

    Swift

    func lengthTo(_ b: GLMapPoint) -> Double

    Parameters

    a

    First point

    b

    Second point

    Return Value

    length (in internal map units)

  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *CostingOptionsAutoSerialize(const CostingOptionsAuto *options)

    Swift

    func serialize() -> String!
  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *
    CostingOptionsBicycleSerialize(const CostingOptionsBicycle *options)

    Swift

    func serialize() -> String!
  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *
    CostingOptionsPedestrianSerialize(const CostingOptionsPedestrian *options)

    Swift

    func serialize() -> String!
  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *
    CostingOptionsStraightSerialize(const CostingOptionsStraight *options)

    Swift

    func serialize() -> String!
  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *
    CostingOptionsMotorcycleSerialize(const CostingOptionsMotorcycle *options)

    Swift

    func serialize() -> String!
  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *
    CostingOptionsTruckSerialize(const CostingOptionsTruck *options)

    Swift

    func serialize() -> String!
  • Serialize options to string

    Declaration

    Objective-C

    extern NSString *
    CostingOptionsMotorScooterSerialize(const CostingOptionsMotorScooter *options)

    Swift

    func serialize() -> String!
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsAutoInit(CostingOptionsAuto *options, NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsBicycleInit(CostingOptionsBicycle *options,
                                           NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsPedestrianInit(CostingOptionsPedestrian *options,
                                              NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsStraightInit(CostingOptionsStraight *options,
                                            NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsMotorcycleInit(CostingOptionsMotorcycle *options,
                                              NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsTruckInit(CostingOptionsTruck *options,
                                         NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool
  • Init from serialized string

    Declaration

    Objective-C

    extern _Bool CostingOptionsMotorScooterInit(CostingOptionsMotorScooter *options,
                                                NSString *data)

    Swift

    mutating func read(_ data: String!) -> Bool