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 is a block with a 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
  • GLMapMarkerLocationBlock is called for each marker to get the marker location.

    Declaration

    Objective-C

    typedef GLMapPoint (^GLMapMarkerLocationBlock)(id _Nonnull)

    Swift

    typealias GLMapMarkerLocationBlock = (Any) -> GLMapPoint
  • GLMapMarkerUnionFillBlock is called when the marker layer needs a style for a cluster of count 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
  • 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 for pan gestures. 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<NSNumber *> *_Nonnull)

    Swift

    typealias GLMapVisibleTilesChangedBlock = (Set<NSNumber>) -> Void

    Parameters

    visibleTiles

    A set of NSNumber tile hashes (uint64_t).

  • GLMapCaptureFrameBlock is called when a frame is captured.

    Declaration

    Objective-C

    typedef void (^GLMapCaptureFrameBlock)(PlatformImage *_Nullable)

    Swift

    typealias GLMapCaptureFrameBlock = (NSImage?) -> Void

    Parameters

    image

    Captured frame image, or nil if capture failed.

  • 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 a 32-bit color type stored as 0xAABBGGRR (ABGR).

    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
  • Track point with a per-point color.

    See more

    Declaration

    Objective-C

    typedef struct GLTrackPoint GLTrackPoint
  • Route point (location) used in routing requests and results.

    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
  • GLMapUnitsFormatterBlock is used to change the scale ruler format or localize the unit name.

    Declaration

    Objective-C

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

    Swift

    typealias GLMapUnitsFormatterBlock = (GLUnits, Int32) -> String?
  • 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 an opaque handle to an internal marker object.

    Declaration

    Objective-C

    typedef void *GLMapMarkerData

    Swift

    typealias GLMapMarkerData = UnsafeMutableRawPointer
  • GLMapPoint always uses internal map coordinates in the range [0, GLMapPointMax] for both axes. The 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.

  • Callback used to provide track points.

    Note

    To start a new segment, set pt->pt to {NAN, NAN}.

    Declaration

    Objective-C

    typedef BOOL (^GLMapTrackPointsCallback)(NSUInteger, GLTrackPoint *_Nonnull)

    Swift

    typealias GLMapTrackPointsCallback = (UInt, UnsafeMutablePointer<GLTrackPoint>) -> Bool

    Parameters

    index

    Point index requested by the framework.

    pt

    Output: track point to return.

    Return Value

    YES if pt was filled, or NO to stop enumeration (only used when count is 0).

  • 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

    Return value is reserved for future use; return YES.

  • User-defined function that can 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?

    Parameters

    params

    Optional user parameters.

    args

    Function arguments.

    argsCount

    Number of arguments in args.

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

  • Completion block for an elevation request.

    Declaration

    Objective-C

    typedef void (^GLMapHeightDataCompletionBlock)(GLRouteElevation *_Nullable,
                                                   NSError *_Nullable)

    Swift

    typealias GLMapHeightDataCompletionBlock = (GLRouteElevation?, (any Error)?) -> Void

    Parameters

    result

    An instance of GLRouteElevation containing the height profile, or nil if the request failed.

    error

    An error describing the failure, if any.

  • Block that is called when the request finishes.

    Declaration

    Objective-C

    typedef void (^GLRouteRequestCompletionBlock)(GLRoute *_Nullable,
                                                  NSError *_Nullable)

    Swift

    typealias GLRouteRequestCompletionBlock = (GLRoute?, (any Error)?) -> Void

    Parameters

    result

    An instance of GLRoute with information about the route.

    error

    Contains an error if the request has 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
  • GLSearchCompletionBlock is called on the main queue when an asynchronous search finishes.

    Declaration

    Objective-C

    typedef void (^GLSearchCompletionBlock)(GLMapVectorObjectArray *_Nonnull)

    Swift

    typealias GLSearchCompletionBlock = (GLMapVectorObjectArray) -> Void

    Parameters

    results

    Search results.

  • GLSearchInfoBlock is called to fetch information 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

    Parameters

    result

    Custom object from the customObjects array.

    location

    Output: object location in internal map coordinates (GLMapPoint).

    category

    Output: object category (optional).

    scoreBonus

    Output: extra score bonus (optional).