Type Definitions
The following type definitions are available globally.
-
GLMapAnimationCompletionBlockis called when the animation ends.finishedis 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 -
GLMapMarkerDataFillBlockis 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 -
GLMapMarkerPositionBlockis called for each marker to get the location of the marker.Declaration
Objective-C
typedef GLMapPoint (^GLMapMarkerLocationBlock)(id _Nonnull)Swift
typealias GLMapMarkerLocationBlock = (Any) -> GLMapPoint -
GLMapMarkerUnionBlockis called when the marker layer needs a style for a union ofcountmarkers.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
bboxThe BBox of the tracks.
Return Value
An array of
GLMapTrackData. -
GLMapTimestampBlockis 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 -
ColorTransformBlockis used to transform colors of an image.Declaration
Objective-C
typedef GLMapColor (^ColorTransformBlock)(GLMapColor)Swift
typealias ColorTransformBlock = (GLMapColor) -> GLMapColor -
RectTransformBlockis used to transform the draw rect of an image.Declaration
Objective-C
typedef CGRect (^RectTransformBlock)(CGRect)Swift
typealias RectTransformBlock = (CGRect) -> CGRect -
GLMapTapGestureBlockis called when the user taps or long presses on the map. Add custom tap handling logic inside this block.Declaration
Objective-C
typedef void (^GLMapTapGestureBlock)(CGPoint)Swift
typealias GLMapTapGestureBlock = (CGPoint) -> Void -
GLMapAnimationBlockis created for animations. Map properties modified insideGLMapAnimationBlockwill use animation. Animation properties can be changed in theanimationobject.Declaration
Objective-C
typedef void (^GLMapAnimationBlock)(GLMapAnimation *_Nonnull)Swift
typealias GLMapAnimationBlock = (GLMapAnimation) -> Void -
GLMapVisibleTilesChangedBlockis called when the set of visible tiles changes.Declaration
Objective-C
typedef void (^GLMapVisibleTilesChangedBlock)(NSSet *_Nonnull)Swift
typealias GLMapVisibleTilesChangedBlock = (Set<AnyHashable>) -> Void -
GLMapCaptureFrameBlockis called when a frame is captured.Declaration
Objective-C
typedef void (^GLMapCaptureFrameBlock)(PlatformImage *_Nullable)Swift
typealias GLMapCaptureFrameBlock = (NSImage?) -> Void -
See moreGLMapColoris color type based onuint32_tDeclaration
Objective-C
typedef struct GLMapColor GLMapColor -
Resource information filled by
See moreGLMapResourceBlockDeclaration
Objective-C
typedef struct GLMapResource GLMapResource -
Merkator tile coordinates
See moreDeclaration
Objective-C
typedef struct GLMapTilePos GLMapTilePos -
GLMapResourceBlockis 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 *GLMapPointSetSwift
typealias GLMapPointSet = UnsafeMutableRawPointer -
Set of GLMapPoint
Declaration
Objective-C
typedef void *GLMapBBoxSetSwift
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 -
Blocks that will be called on the main thread when the subtask is completed or canceled. Download task contains map data download task and navigation data download task inside.
Declaration
Objective-C
typedef void (^GLMapDownloadStatsBlock)(NSString *_Nonnull, NSUInteger, double)Swift
typealias GLMapDownloadStatsBlock = (String, UInt, Double) -> Void -
GLMapListUpdateBlockis 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. -
GLMapTileDownloadProgressBlockis called when a tile is downloaded.Declaration
Objective-C
typedef BOOL (^GLMapTileDownloadProgressBlock)(uint64_t, NSError *_Nullable)Swift
typealias GLMapTileDownloadProgressBlock = (UInt64, (any Error)?) -> BoolReturn Value
If NO is returned, the downloading will be canceled.
-
GLMapFloatBlockis called when an asynchronous request for slope or elevation is finished.Declaration
Objective-C
typedef void (^GLMapFloatBlock)(float)Swift
typealias GLMapFloatBlock = (Float) -> Void -
GLMapDownloadProgressis 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 -
GLMapDownloadCompletionis called when the download is finished.Declaration
Objective-C
typedef void (^GLMapDownloadCompletion)(NSError *_Nullable)Swift
typealias GLMapDownloadCompletion = ((any Error)?) -> Void -
GLMapMarkerDatais type used to reference an internal object.Declaration
Objective-C
typedef void *GLMapMarkerDataSwift
typealias GLMapMarkerData = UnsafeMutableRawPointer -
See moreGLMapPointalways uses internal map coordinates. From 0 toGLMapPointMaxfor 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) -> GLMapPointParameters
indexIndex 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) -> VoidParameters
indexPoint index.
pointPoint.
-
Block is called to get point of track at given
indexDeclaration
Objective-C
typedef BOOL (^GLMapTrackPointsCallback)(NSUInteger, GLTrackPoint *_Nonnull)Swift
typealias GLMapTrackPointsCallback = (UInt, UnsafeMutablePointer<GLTrackPoint>) -> BoolReturn 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) -> BoolReturn 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) -> GLMapColorParameters
indexIndex 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) -> VoidParameters
pointPoint inside maneuver
heightHeight 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)?) -> VoidParameters
resultinstance of GLRouteElevation with information about height
errorcontains 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)?) -> VoidParameters
resultinstance of GLRoute with information about the route
errorcontains 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 -
GLMapSearchCompletionBlockis called when the search task is finished. If results is nil, the task is canceled.Warning
If custom results are also added, results will containGLMapVectorObjects and objects of the user type.Declaration
Objective-C
typedef void (^GLSearchCompletionBlock)(GLMapVectorObjectArray *_Nonnull)Swift
typealias GLSearchCompletionBlock = (GLMapVectorObjectArray) -> Void -
GLMapSearchInfoBlockis 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
Install in Dash
Type Definitions Reference