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:(int32_t)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 (atomic, assign, unsafe_unretained, readwrite) BOOL rotatesWithMap;
-
GLMapTransform mode of drawable
Declaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) GLMapTransformMode transformMode;
-
A position that sets image position in map internal coordinates For vector object adds translation Animatable.
Declaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) GLMapPoint position;
-
A size of image in pixels Can be used for image and text
Declaration
Objective-C
@property (atomic, readonly) CGSize size;
-
Scale of object. (by default is 1.0) Animatable.
Declaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) double scale;
-
A float variable that defines image angle Animatable.
Declaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) float angle;
-
Loads image into
GLMapDrawable
This variant will not load anything into OpenGL utilGLMapDrawable
will be added to some mapView that will try to render it.UIImage
will be retained byGLMapDrawable
.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 imageDeclaration
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
See
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
See
Declaration
Objective-C
- (void)setVectorObject:(GLMapVectorObject *_Nonnull)object withStyle:(GLMapVectorCascadeStyle *_Nonnull)style completion:(dispatch_block_t _Nullable)completion;
Parameters
object
object to draw
style
A style of object
completion
A block called when object ready to draw
-
Sets vector objects to draw
See
Declaration
Objective-C
- (void)setVectorObjects:(GLMapVectorObjectArray *_Nonnull)objects withStyle:(GLMapVectorCascadeStyle *_Nonnull)style completion:(dispatch_block_t _Nullable)completion;
Parameters
objects
objects to draw
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