Type Definitions
The following type definitions are available globally.
-
GLMapAnimationCompletionBlock
is called when the animation ends.finished
is set to YES when the animation is finished, and NO when the animation is canceled.Declaration
Objective-C
typedef void (^GLMapAnimationCompletionBlock)(BOOL)
Swift
typealias GLMapAnimationCompletionBlock = (Bool) -> Void
-
GLMapMarkerDataFillBlock
is called for each marker to fill the needed data.Declaration
Objective-C
typedef void (^GLMapMarkerDataFillBlock)(id _Nonnull, GLMapMarkerData _Nonnull)
Swift
typealias GLMapMarkerDataFillBlock = (Any, GLMapMarkerData) -> Void
-
GLMapMarkerPositionBlock
is called for each marker to get the location of the marker.Declaration
Objective-C
typedef GLMapPoint (^GLMapMarkerLocationBlock)(id _Nonnull)
Swift
typealias GLMapMarkerLocationBlock = (Any) -> GLMapPoint
-
GLMapMarkerUnionBlock
is called when the marker layer needs a style for a union ofcount
markers.Declaration
Objective-C
typedef void (^GLMapMarkerUnionFillBlock)(uint32_t, GLMapMarkerData _Nonnull)
Swift
typealias GLMapMarkerUnionFillBlock = (UInt32, GLMapMarkerData) -> Void
-
A block is called to get track data for a given bbox.
Declaration
Objective-C
typedef NSArray<GLMapTrackData *> *_Nullable (^GLMapTrackDataCallback)( GLMapBBox)
Swift
typealias GLMapTrackDataCallback = (GLMapBBox) -> [GLMapTrackData]?
Parameters
bbox
The BBox of the tracks.
Return Value
An array of
GLMapTrackData
. -
GLMapTimestampBlock
is used to get the timestamp of a resource from a custom place. Return NAN if no resources with such name exist.Declaration
Objective-C
typedef double (^GLMapTimestampBlock)(NSString *_Nonnull)
Swift
typealias GLMapTimestampBlock = (String) -> Double
-
ColorTransformBlock
is used to transform colors of an image.Declaration
Objective-C
typedef GLMapColor (^ColorTransformBlock)(GLMapColor)
Swift
typealias ColorTransformBlock = (GLMapColor) -> GLMapColor
-
RectTransformBlock
is used to transform the draw rect of an image.Declaration
Objective-C
typedef CGRect (^RectTransformBlock)(CGRect)
Swift
typealias RectTransformBlock = (CGRect) -> CGRect
-
GLMapTapGestureBlock
is called to add custom tap handling logic inside this block.Declaration
Objective-C
typedef BOOL (^GLMapGestureBlock)(PlatformGestureRecognizer *_Nonnull)
Swift
typealias GLMapGestureBlock = (NSGestureRecognizer) -> Bool
-
GLMapAnimationBlock
is created for animations. Map properties modified insideGLMapAnimationBlock
will use animation. Animation properties can be changed in theanimation
object.Declaration
Objective-C
typedef void (^GLMapAnimationBlock)(GLMapAnimation *_Nonnull)
Swift
typealias GLMapAnimationBlock = (GLMapAnimation) -> Void
-
GLMapVisibleTilesChangedBlock
is called when the set of visible tiles changes.Declaration
Objective-C
typedef void (^GLMapVisibleTilesChangedBlock)(NSSet *_Nonnull)
Swift
typealias GLMapVisibleTilesChangedBlock = (Set<AnyHashable>) -> Void
-
GLMapCaptureFrameBlock
is called when a frame is captured.Declaration
Objective-C
typedef void (^GLMapCaptureFrameBlock)(PlatformImage *_Nullable)
Swift
typealias GLMapCaptureFrameBlock = (NSImage?) -> Void
-
GLMapValueChangedBlock
is called every time value is cnahed by guestureDeclaration
Objective-C
typedef void (^GLMapValueChangedBlock)(_Bool)
Swift
typealias GLMapValueChangedBlock = (Bool) -> Void
-
See moreGLMapColor
is color type based onuint32_t
Declaration
Objective-C
typedef struct GLMapColor GLMapColor
-
Resource information filled by
See moreGLMapResourceBlock
Declaration
Objective-C
typedef struct GLMapResource GLMapResource
-
Merkator tile coordinates
See moreDeclaration
Objective-C
typedef struct GLMapTilePos GLMapTilePos
-
GLMapResourceBlock
is used to load resources from custom place.Declaration
Objective-C
typedef GLMapResource (^GLMapResourceBlock)(NSString *_Nonnull)
Swift
typealias GLMapResourceBlock = (String) -> GLMapResource
-
Point of track with color
See moreDeclaration
Objective-C
typedef struct GLTrackPoint GLTrackPoint
-
Point of track with color
See moreDeclaration
Objective-C
typedef struct GLRoutePoint GLRoutePoint
-
Set of GLMapPoint
Declaration
Objective-C
typedef void *GLMapPointSet
Swift
typealias GLMapPointSet = UnsafeMutableRawPointer
-
Set of GLMapPoint
Declaration
Objective-C
typedef void *GLMapBBoxSet
Swift
typealias GLMapBBoxSet = UnsafeMutableRawPointer
-
Result of track sampling
See moreDeclaration
Objective-C
typedef struct GLTrackSampleResult GLTrackSampleResult
-
Geo point with latitude and longitude
See moreDeclaration
Objective-C
typedef struct GLMapGeoPoint GLMapGeoPoint
-
Blocks that will be called on the main thread when the task is completed or canceled.
Declaration
Objective-C
typedef void (^GLMapDownloadCompletionBlock)(GLMapDownloadTask *_Nonnull)
Swift
typealias GLMapDownloadCompletionBlock = (GLMapDownloadTask) -> Void
-
GLMapListUpdateBlock
is used to notify about map list updates. The map list is stored on the server and sometimes it takes some time to fetch the latest map list. It is downloaded only if updated. If no changes occurred, the block is called almost immediately. -
GLMapTileDownloadProgressBlock
is called when a tile is downloaded.Declaration
Objective-C
typedef BOOL (^GLMapTileDownloadProgressBlock)(uint64_t, NSError *_Nullable)
Swift
typealias GLMapTileDownloadProgressBlock = (UInt64, (any Error)?) -> Bool
Return Value
If NO is returned, the downloading will be canceled.
-
GLMapFloatBlock
is called when an asynchronous request for slope or elevation is finished.Declaration
Objective-C
typedef void (^GLMapFloatBlock)(float)
Swift
typealias GLMapFloatBlock = (Float) -> Void
-
GLMapDownloadProgress
is periodically called to report the progress of the download.Declaration
Objective-C
typedef void (^GLMapDownloadProgress)(NSUInteger, NSUInteger, double)
Swift
typealias GLMapDownloadProgress = (UInt, UInt, Double) -> Void
-
GLMapDownloadCompletion
is called when the download is finished.Declaration
Objective-C
typedef void (^GLMapDownloadCompletion)(NSError *_Nullable)
Swift
typealias GLMapDownloadCompletion = ((any Error)?) -> Void
-
GLMapMarkerData
is type used to reference an internal object.Declaration
Objective-C
typedef void *GLMapMarkerData
Swift
typealias GLMapMarkerData = UnsafeMutableRawPointer
-
See moreGLMapPoint
always uses internal map coordinates. From 0 toGLMapPointMax
for X and Y axis. Origin is at the top left corner.Declaration
Objective-C
typedef struct GLMapPoint GLMapPoint
-
Generator block. Returns points for index. Used in generating constructor
-initWithCount:callback:
.Declaration
Objective-C
typedef GLMapPoint (^GetPointBlock)(NSUInteger)
Swift
typealias GetPointBlock = (UInt) -> GLMapPoint
Parameters
index
Index of the point.
Return Value
Point to add to the array.
-
Enumerator block. Called for all points subsequently.
Declaration
Objective-C
typedef void (^EnumeratePointBlock)(NSUInteger, GLMapPoint)
Swift
typealias EnumeratePointBlock = (UInt, GLMapPoint) -> Void
Parameters
index
Point index.
point
Point.
-
Block is called to get point of track at given
index
Declaration
Objective-C
typedef BOOL (^GLMapTrackPointsCallback)(NSUInteger, GLTrackPoint *_Nonnull)
Swift
typealias GLMapTrackPointsCallback = (UInt, UnsafeMutablePointer<GLTrackPoint>) -> Bool
Return Value
YES if there is point at index
index
, and NO if there is no points. -
TintFunctionBlock is used to customize tint function. E.g. It’s possible to add custom mapping for specific colors.
Declaration
Objective-C
typedef GLMapColor (^TintFunctionBlock)(GLMapColor, GLMapColor)
Swift
typealias TintFunctionBlock = (GLMapColor, GLMapColor) -> GLMapColor
-
Called when next object is ready while enumerating
Declaration
Objective-C
typedef BOOL (^GLMapVectorObjectBlock)(GLMapVectorObject *_Nonnull)
Swift
typealias GLMapVectorObjectBlock = (GLMapVectorObject) -> Bool
Return Value
NO to break enumaration
-
User function that could be declared in code and called from MapCSS
Declaration
Objective-C
typedef GLMapValue *_Nullable (^GLMapFunction)( void *_Nullable, const GLMapValue *const _Nullable *_Nullable, int)
Swift
typealias GLMapFunction = (UnsafeMutableRawPointer?, UnsafePointer<GLMapValue?>?, Int32) -> GLMapValue?
-
Block that will be called to make gradients for track
Declaration
Objective-C
typedef GLMapColor (^GLMapTrackDataColorBlock)(uint32_t)
Swift
typealias GLMapTrackDataColorBlock = (UInt32) -> GLMapColor
Parameters
index
Index of point
Return Value
Color of the point
-
Enumerator block. Called subsequently for all maneuver points
Declaration
Objective-C
typedef void (^GLRouteEnumPointsBlock)(GLMapPoint, float)
Swift
typealias GLRouteEnumPointsBlock = (GLMapPoint, Float) -> Void
Parameters
point
Point inside maneuver
height
Height in that point if available, NAN otherwise.
-
Block that will be called when the request is finished
Declaration
Objective-C
typedef void (^GLMapHeightDataCompletionBlock)(GLRouteElevation *_Nullable, NSError *_Nullable)
Swift
typealias GLMapHeightDataCompletionBlock = (GLRouteElevation?, (any Error)?) -> Void
Parameters
result
instance of GLRouteElevation with information about height
error
contains error if request is failed
-
Block that will be called when request is finished
Declaration
Objective-C
typedef void (^GLRouteRequestCompletionBlock)(GLRoute *_Nullable, NSError *_Nullable)
Swift
typealias GLRouteRequestCompletionBlock = (GLRoute?, (any Error)?) -> Void
Parameters
result
instance of GLRoute with information about the route
error
contains error if request is failed
-
General penalties
See moreDeclaration
Objective-C
typedef struct CostingOptionsPenalties CostingOptionsPenalties
-
General options when driving on road
See moreDeclaration
Objective-C
typedef struct CostingOptionsRoad CostingOptionsRoad
-
Options for vehicle
See moreDeclaration
Objective-C
typedef struct CostingOptionsVehicle CostingOptionsVehicle
-
Options for auto, bus, taxi mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsAuto CostingOptionsAuto
-
Options for truck mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsTruck CostingOptionsTruck
-
Options for bicycle mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsBicycle CostingOptionsBicycle
-
Options for straight mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsMotorScooter CostingOptionsMotorScooter
-
Options for straight mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsMotorcycle CostingOptionsMotorcycle
-
Options for pedestrian mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsPedestrian CostingOptionsPedestrian
-
Options for straight mode
See moreDeclaration
Objective-C
typedef struct CostingOptionsStraight CostingOptionsStraight
-
GLMapSearchCompletionBlock
is called when the search task is finished. If results is nil, the task is canceled.Warning
If custom results are also added, results will containGLMapVectorObject
s and objects of the user type.Declaration
Objective-C
typedef void (^GLSearchCompletionBlock)(GLMapVectorObjectArray *_Nonnull)
Swift
typealias GLSearchCompletionBlock = (GLMapVectorObjectArray) -> Void
-
GLMapSearchInfoBlock
is called to fetch information that is used to sort custom search results.Declaration
Objective-C
typedef void (^GLSearchInfoBlock)(id _Nonnull, GLMapPoint *_Nonnull, GLSearchCategory *_Nullable *_Nonnull, int *_Nonnull)
Swift
typealias GLSearchInfoBlock = (Any, UnsafeMutablePointer<GLMapPoint>, AutoreleasingUnsafeMutablePointer<GLSearchCategory?>, UnsafeMutablePointer<Int32>) -> Void