Functions
The following functions are available globally.
-
Changes map marker style
Declaration
Objective-C
void GLMapMarkerSetStyle(GLMapMarkerData _Nonnull data, unsigned int style)
Parameters
data
Marker object to be changed
style
Style identifier
-
Sets text for map marker.
Declaration
Objective-C
void GLMapMarkerSetText(GLMapMarkerData _Nonnull data, NSString *_Nonnull text, CGPoint offset, GLMapVectorStyle *_Nonnull style)
Parameters
data
Marker object to be changed
text
Text for marker object
offset
offset on screen in points
style
Text style
-
Checks if it’s error or success code
Declaration
Objective-C
static inline _Bool GLMapIsSuccess(GLMapError v)
-
Creates
GLMapTilePos
Declaration
Objective-C
static inline GLMapTilePos GLMapTilePosMake(int x, int y, int z)
Parameters
x
X coordinate
y
Y coordinate
z
Z coordinate
Return Value
New tile position
-
Creates new
GLMapGeoPoint
.Declaration
Objective-C
static inline GLMapGeoPoint GLMapGeoPointMake(double lat, double lon)
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)
Parameters
a
First geo point
b
Second geo point
Return Value
true
if map points is equal -
Creates new
GLMapPoint
Declaration
Objective-C
static inline GLMapPoint GLMapPointMake(double x, double y)
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)
Parameters
a
First map point
b
Second map point
Return Value
true
if map points is equal -
Length between two points
Declaration
Objective-C
double GLMapPointLength(GLMapPoint a, GLMapPoint b)
Parameters
a
First point
b
Second point
Return Value
length (in internal map units)
-
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)
Parameters
r
Red channel value
g
Green channel value
b
Blue channel value
a
Alpha channel value
Return Value
Returns new color object
-
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)
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)
Parameters
color
Input color
Return Value
Returns red channel value
-
Declaration
Objective-C
static inline uint8_t GLMapColorGetGreen(GLMapColor color)
Parameters
color
Input color
Return Value
Returns green channel value
-
Declaration
Objective-C
static inline uint8_t GLMapColorGetBlue(GLMapColor color)
Parameters
color
Input color
Return Value
Returns blue channel value
-
Declaration
Objective-C
static inline uint8_t GLMapColorGetAlpha(GLMapColor color)
Parameters
color
Input color
Return Value
Returns alpha channel value
-
Creates
CGColor
object from ourGLMapColor
Declaration
Objective-C
struct CGColor *_Nullable CGColorFromGLMapColor(GLMapColor color)
Parameters
color
Initial color
Return Value
New
CGColor
object -
Creates
NSColor
object from ourGLMapColor
Declaration
Objective-C
NSColor *_Nullable NSColorFromGLMapColor(GLMapColor color)
Parameters
color
Initial color
Return Value
New
NSColor
object -
Converts
NSData
objects intoGLMapResources
.Declaration
Objective-C
GLMapResource GLMapResourceWithData(NSData *_Nonnull 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)
-
Adds point into existing bounding box.
Declaration
Objective-C
static inline GLMapBBox GLMapBBoxAddPoint(GLMapBBox bbox, GLMapPoint point)
Parameters
bbox
Bounding box
point
Point to add into bounding box
-
Checks if the bbox contains the point
Declaration
Objective-C
static inline _Bool GLMapBBoxContains(GLMapBBox bbox, GLMapPoint point)
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)
Parameters
origin
Origin point
width
Width
height
Height
Return Value
New bounding box
-
Returns center of bbox
Declaration
Objective-C
static inline GLMapPoint GLMapBBoxCenter(GLMapBBox a)
Return Value
center of bbox
-
Computes distance from bounding box to point
Declaration
Objective-C
double GLMapBBoxDistanceToPoint(GLMapBBox bbox, GLMapPoint point)
Parameters
bbox
Bounding box
point
Point
Return Value
Distance in internal coordinates
-
Creates map point from geo coordinates
Declaration
Objective-C
GLMapPoint GLMapPointMakeFromGeoCoordinates(double lat, double lon)
Parameters
lat
Latitude
lon
Longitude
Return Value
New map point
-
Creates map point from geo point
Declaration
Objective-C
GLMapPoint GLMapPointFromMapGeoPoint(GLMapGeoPoint point)
Parameters
point
Geo point
Return Value
New point
-
Creates map point from tile position
Declaration
Objective-C
GLMapPoint GLMapPointFromMapTilePos(GLMapTilePos tilePos)
Parameters
tilePos
Tile position
Return Value
New point
-
Creates geo point from map coordinates
Declaration
Objective-C
GLMapGeoPoint GLMapGeoPointFromMapPoint(GLMapPoint point)
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)
Parameters
a
First point on map
b
Second point on map
Return Value
Distance in meters
-
Calculates distance between two points. Сontains internal conversion to GLMapGeoPoint.
Declaration
Objective-C
double GLMapDistanceBetweenGeoPoints(GLMapGeoPoint a, GLMapGeoPoint b)
Parameters
a
First geo point
b
Second geo point
Return Value
Distance in meters
-
Calculates bearing between two geo points.
Declaration
Objective-C
double GLMapBearingBetweenPoints(GLMapPoint a, GLMapPoint b)
Parameters
a
First point
b
Second point
Return Value
bearing angle in degrees
-
Calculates bearing between two points. Сontains internal conversion to GLMapGeoPoint.
Declaration
Objective-C
double GLMapBearingBetweenGeoPoints(GLMapGeoPoint a, GLMapGeoPoint b)
Parameters
a
First geo point
b
Second geo point
Return Value
bearing angle in degrees
-
Creates new empty set *
Declaration
Objective-C
GLMapPointSet _Nonnull GLMapPointSetCreate()
-
Destroys set
Declaration
Objective-C
void GLMapPointSetDestroy(GLMapPointSet _Nonnull set)
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)
Parameters
set
set to modify
point
point to add *
-
Inserts new point to set.
Declaration
Objective-C
_Bool GLMapPointSetInsertUnique(GLMapPointSet _Nonnull set, GLMapPoint point)
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)
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)
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)
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()
-
Destroys set
Declaration
Objective-C
void GLMapBBoxSetDestroy(GLMapBBoxSet _Nonnull set)
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)
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)
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)
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)
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