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
  • GLMapLabelBlock block with GLMapLabel parameter

    Declaration

    Objective-C

    typedef void (^GLMapLabelBlock)(GLMapLabel *_Nonnull)

    Swift

    typealias GLMapLabelBlock = (GLMapLabel) -> 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 of count markers.

    Declaration

    Objective-C

    typedef void (^GLMapMarkerUnionFillBlock)(uint32_t, GLMapMarkerData _Nonnull)

    Swift

    typealias GLMapMarkerUnionFillBlock = (UInt32, GLMapMarkerData) -> Void
  • GLMapScaleRulerTextFormatterBlock is used to change the scale ruler format or localize the unit name.

    Declaration

    Objective-C

    typedef NSString *_Nullable (^GLMapScaleRulerTextFormatterBlock)(int, GLUnits)

    Swift

    typealias GLMapScaleRulerTextFormatterBlock = (Int32, GLUnits) -> String?
  • 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
  • GLMapGestureBlock is called to add custom tap handling logic inside this block.

    Declaration

    Objective-C

    typedef void (^GLMapTapGestureBlock)(PlatformGestureRecognizer *_Nonnull)

    Swift

    typealias GLMapTapGestureBlock = (NSGestureRecognizer) -> Void
  • GLMapPanGestureBlock is called to add custom tap handling logic inside this block. Return YES to handle the gesture.

    Declaration

    Objective-C

    typedef BOOL (^GLMapPanGestureBlock)(PlatformGestureRecognizer *_Nonnull)

    Swift

    typealias GLMapPanGestureBlock = (NSGestureRecognizer) -> Bool
  • GLMapBBoxChangedBlock is called every time the map is moved or zoomed.

    Declaration

    Objective-C

    typedef void (^GLMapBBoxChangedBlock)(GLMapBBox)

    Swift

    typealias GLMapBBoxChangedBlock = (GLMapBBox) -> Void
  • GLMapAnimationBlock is created for animations. Map properties modified inside GLMapAnimationBlock will use animation. Animation properties can be changed in the animation 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 each time the value changes during a gesture.

    Declaration

    Objective-C

    typedef void (^GLMapValueChangedBlock)(_Bool)

    Swift

    typealias GLMapValueChangedBlock = (Bool) -> Void

    Parameters

    finalValue

    Indicates whether the gesture has ended and the value is final.

  • GLMapColor is color type based on uint32_t

    See more

    Declaration

    Objective-C

    typedef struct GLMapColor GLMapColor
  • Resource information filled by GLMapResourceBlock

    See more

    Declaration

    Objective-C

    typedef struct GLMapResource GLMapResource
  • Merkator tile coordinates

    See more

    Declaration

    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
  • Rectangle contains all corner points

    See more

    Declaration

    Objective-C

    typedef struct GLMapRect GLMapRect
  • Point of track with color

    See more

    Declaration

    Objective-C

    typedef struct GLTrackPoint GLTrackPoint
  • Point of track with color

    See more

    Declaration

    Objective-C

    typedef struct GLRoutePoint GLRoutePoint
  • Bounding box

    See more

    Declaration

    Objective-C

    typedef struct GLMapBBox GLMapBBox
  • 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 more

    Declaration

    Objective-C

    typedef struct GLTrackSampleResult GLTrackSampleResult
  • Geo point with latitude and longitude

    See more

    Declaration

    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.

    Declaration

    Objective-C

    typedef void (^GLMapListUpdateBlock)(NSArray<GLMapInfo *> *_Nullable, BOOL,
                                         NSError *_Nullable)

    Swift

    typealias GLMapListUpdateBlock = ([GLMapInfo]?, Bool, (any Error)?) -> Void
  • 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
  • GLMapPoint always uses internal map coordinates. From 0 to GLMapPointMax for X and Y axis. Origin is at the top left corner.

    See more

    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 the next object is ready while enumerating.

    Declaration

    Objective-C

    typedef BOOL (^GLMapVectorObjectBlock)(GLMapVectorObject *_Nonnull)

    Swift

    typealias GLMapVectorObjectBlock = (GLMapVectorObject) -> Bool

    Return Value

    NO to break enumeration

  • 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 more

    Declaration

  • General options when driving on road

    See more

    Declaration

    Objective-C

    typedef struct CostingOptionsRoad CostingOptionsRoad
  • Options for vehicle

    See more

    Declaration

    Objective-C

    typedef struct CostingOptionsVehicle CostingOptionsVehicle
  • Options for auto, bus, taxi mode

    See more

    Declaration

    Objective-C

    typedef struct CostingOptionsAuto CostingOptionsAuto
  • Options for truck mode

    See more

    Declaration

    Objective-C

    typedef struct CostingOptionsTruck CostingOptionsTruck
  • Options for bicycle mode

    See more

    Declaration

    Objective-C

    typedef struct CostingOptionsBicycle CostingOptionsBicycle
  • Options for straight mode

    See more

    Declaration

  • Options for straight mode

    See more

    Declaration

  • Options for pedestrian mode

    See more

    Declaration

  • Options for straight mode

    See more

    Declaration

    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 contain GLMapVectorObjects 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