GLMapDrawable


@interface GLMapDrawable : GLMapDrawObject

Normal drawable: 0, GLMapPointMax GLMapPointMax, GLMapPointMax ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ ╭────────────────────T ┃ ┃ │ │ ┃ ┃ │←╍╍╍╍╍╍╍╍╍╍╍╍╍P │ ┃ ┃ │ ╏ │ ┃ ┃ │ ╏ │ ┃ ┃ │ ↓ │ ┃ ┃ O──────────────┴─────╯ ┃ ↑ ┃ ┗━→━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 0,0 GLMapPointMax,0

P = position (GLMapPoint) O = position - offset * scale (pt) T = O + size * scale (pt)

Drawable that uses transform: 0, GLMapPointMax GLMapPointMax, GLMapPointMax ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ ╭────────────────────T ┃ ┃ │ │ ┃ ┃ │ │ ┃ ┃ │ │ ┃ ┃ │ │ ┃ ┃ │ │ ┃ ┃ P────────────────────╯ ┃ ↑ ┃ ┗━━→━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 0,0 GLMapPointMax,0

P = position (GLMapPoint) T = position + size * scale (GLMapPoint) *

  • Initializes empty image that will be displayed with given drawOrder

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithDrawOrder:(int)drawOrder;

    Parameters

    drawOrder

    drawOrder of object

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

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;
  • When set to YES image rotates with map. Default value is ‘NO’

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) BOOL rotatesWithMap;
  • A Boolean value that determines whether the image is hidden. Default value is ‘NO’

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) BOOL hidden;
  • GLMapTransform mode of drawable

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) GLMapTransformMode transformMode;
  • A position that sets image position in map internal coordinates For vector object adds translation Animatable.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) GLMapPoint position;
  • Image offset from position point. Can be used for image and text When offset is (0,0), bottom left corner of image is displayed at position Animatable.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) CGPoint offset;
  • A size of image in pixels Can be used for image and text

    Declaration

    Objective-C

    @property (readonly, atomic) CGSize size;
  • Scale of object. (by default is 1.0) Animatable.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) double scale;
  • A float variable that defines image angle Animatable.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) float angle;
  • Loads image into GLMapDrawable This variant will not load anything into OpenGL util GLMapDrawable will be added to some mapView that will try to render it. UIImage will be retained by GLMapDrawable.

    Declaration

    Objective-C

    - (void)setImage:(UIImage *_Nonnull)image
          completion:(dispatch_block_t _Nullable)completion;

    Parameters

    image

    New image to display on map

    completion

    A block called when image is replaced.

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

    Declaration

    Objective-C

    - (void)setImage:(UIImage *_Nonnull)image
          forMapView:(GLMapView *_Nonnull)mapView
          completion:(dispatch_block_t _Nullable)completion;

    Parameters

    image

    New image to laod

    mapView

    where to load openGL resources

    completion

    A block called when image is replaced.

  • Sets text to draw

    Declaration

    Objective-C

    - (void)setText:(NSString *_Nonnull)text
          withStyle:(GLMapVectorStyle *_Nonnull)style
         completion:(dispatch_block_t _Nullable)completion;

    Parameters

    text

    New text

    style

    A style object used for text

    completion

    A block called when text is replaced.

  • Sets vector object to draw

    Declaration

    Objective-C

    - (void)setVectorObject:(GLMapVectorObject *_Nonnull)object
                 forMapView:(GLMapView *_Nonnull)mapView
                  withStyle:(GLMapVectorCascadeStyle *_Nonnull)style
                 completion:(dispatch_block_t _Nullable)completion;

    Parameters

    object

    object to draw

    mapView

    mapView that contains information for proper work of MapCSS functions

    style

    A style of object

    completion

    A block called when object ready to draw

  • Tests if point is inside of image

    Declaration

    Objective-C

    - (BOOL)hitTest:(CGPoint)point
               onMap:(GLMapView *_Nonnull)mapView
        withPaddings:(UIEdgeInsets)paddings;

    Parameters

    mapView

    mapView where images is displayed

    point

    point to check

    paddings

    paddings of image

    Return Value

    true if point is inside image