GLMapImage

Objective-C


@interface GLMapImage : GLMapDrawable

Swift

class GLMapImage : GLMapDrawable

GLMapImage draws an image on the map.

  • Initializes an empty image that will be displayed with the given drawOrder.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDrawOrder:(int32_t)drawOrder;

    Swift

    init(drawOrder: Int32)

    Parameters

    drawOrder

    The draw order of the object.

  • Initializes an image that will be injected into map tile data (for example, you can set a vector object that can be displayed under map elements).

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Loads an image into GLMapImage. This variant will not load anything into OpenGL until GLMapImage is added to a mapView that will try to render it. UIImage will be retained by GLMapDrawable.

    Declaration

    Objective-C

    - (void)setImage:(nonnull PlatformImage *)image
          completion:(dispatch_block_t _Nullable)completion;

    Swift

    func setImage(_ image: NSImage) async

    Parameters

    image

    The new image to display on the map.

    completion

    A block called when the image is replaced.

  • Loads an image into GLMapImage. This variant of the function loads OpenGL data into the given mapView and does not retain the image itself. You must call this function for every mapView where you will display the image.

    Declaration

    Objective-C

    - (void)setImage:(nonnull PlatformImage *)image
          forMapView:(nonnull GLMapView *)mapView
          completion:(dispatch_block_t _Nullable)completion;

    Swift

    func setImage(_ image: NSImage, for mapView: GLMapView) async

    Parameters

    image

    The new image to load.

    mapView

    The mapView where the OpenGL resources are loaded.

    completion

    A block called when the image is replaced.