GLMapDrawable
Objective-C
@interface GLMapDrawable : GLMapDrawObject
Swift
class GLMapDrawable : GLMapDrawObject
GLMapDrawable is a bridge class to work with the GLMap internal representation of objects that should be rendered on the map. This can be a single image,
text, or vector object. GLMapDrawable can be rendered as a separate object or injected into tile data. Check GLMapImageGroup for large groups of images
or GLMapMarkerLayer to display map markers with clustering.
See
[GLMapView addDrawable:]
See
GLMapMarkerLayer
See
GLMapImageGroup
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)
-
Unavailable
GLMapDrawable is an abstract class
Default -init is disabled.
Declaration
Objective-C
- (instancetype _Nonnull)init;
-
When set to
YES, the image rotates with the map. The default value isNO.Declaration
Objective-C
@property BOOL rotatesWithMap;Swift
var rotatesWithMap: Bool { get set } -
GLMapTransform mode of drawable.
Declaration
Objective-C
@property GLMapTransformMode transformMode;Swift
var transformMode: GLMapTransformMode { get set } -
A position that sets the image position in map internal coordinates. For vector objects, adds translation. Animatable.
-
Image offset from the
positionpoint, measured in image pixels. Can be used for both image and text. When the offset is (0, 0), the bottom-left corner of the image is displayed at the position. When the offset is (image.size.width / 2, 0), it is ideal for a pin. Animatable.Declaration
Objective-C
@property CGPoint offset;Swift
var offset: CGPoint { get set } -
The size of the image in pixels. Can be used for image and text.
Declaration
Objective-C
@property (readonly) CGSize size;Swift
var size: CGSize { get } -
Scale of the object. The default value is 1.0. Animatable.
Declaration
Objective-C
@property double scale;Swift
var scale: Double { get set } -
A float variable that defines the image angle. Animatable.
Declaration
Objective-C
@property float angle;Swift
var angle: Float { get set }
-
Tests if a point is inside the image.
Declaration
Objective-C
- (BOOL)hitTest:(CGPoint)point onMap:(GLMapView *_Nonnull)mapView withPaddings:(PlatformEdgeInsets)paddings;Swift
func hitTest(_ point: CGPoint, onMap mapView: GLMapView, withPaddings paddings: PlatformEdgeInsets) -> BoolParameters
mapViewThe mapView where the image is displayed.
pointThe point to check.
paddingsThe paddings of the image.
Return Value
YESif the point is inside the image.
Install in Dash