GLMapMarkerLayer
@interface GLMapMarkerLayer : GLMapDrawObject
GLMapMarkerLayer
displays big number of markers with given style. It supports marker clustering.
-
Unavailable
Please use inits with data.
Plain -init is disabled
Declaration
Objective-C
- (instancetype _Nonnull)init;
-
Initializes
GLMapMarkerLayer
with given markers andstyle
Declaration
Objective-C
- (nonnull instancetype) initWithMarkers:(nonnull NSArray<id> *)markers andStyles:(nonnull GLMapMarkerStyleCollection *)styleCollection clusteringRadius:(double)clusteringRadius drawOrder:(int)drawOrder;
Parameters
markers
Array of marker objects. Usually you set objects with data, that you need to display on map.
styleCollection
A style collection object used to display markers.
clusteringRadius
Radius of clustering in points (0 will disable clustering)
drawOrder
draw order of layer
Return Value
A new marker layer
-
Initializes
GLMapMarkerLayer
with given array of vector objects andstyle
. When using this constructor location of markers is filled from vector object. It can be modified in style together with style and text.Declaration
Objective-C
- (nonnull instancetype) initWithVectorObjects:(nonnull GLMapVectorObjectArray *)vectorObjects andStyles:(nonnull GLMapMarkerStyleCollection *)styleCollection clusteringRadius:(double)clusteringRadius drawOrder:(int)drawOrder;
Parameters
vectorObjects
Array of vector objects.
styleCollection
A style collection object used to display markers.
clusteringRadius
Radius of clustering in points (0 will disable clustering)
drawOrder
draw order of layer
Return Value
A new marker layer
-
Initializes
GLMapMarkerLayer
with given markers andstyle
Declaration
Objective-C
- (nonnull instancetype) initWithVectorObjects:(nonnull GLMapVectorObjectArray *)objects cascadeStyle:(nonnull GLMapVectorCascadeStyle *)cascadeStyle styleCollection:(nonnull GLMapMarkerStyleCollection *)styleCollection clusteringRadius:(double)clusteringRadius drawOrder:(int)drawOrder;
Parameters
objects
Array of vector objects.
cascadeStyle
A cascade style used to select image for marker.
styleCollection
A style collection object used to display markers.
clusteringRadius
Radius of clustering in points (0 will disable clustering)
drawOrder
draw order of layer
Return Value
A new marker layer
-
Copies markers from other layer
Declaration
Objective-C
- (void)copyMarkersFromLayer:(nonnull GLMapMarkerLayer *)layer;
Parameters
layer
other layer with markers to copy
-
Adds or removes markers on layer
Declaration
Objective-C
- (void)add:(NSArray<id> *_Nullable)markersToAdd remove:(NSArray<id> *_Nullable)markersToRemove reload:(NSArray<id> *_Nullable)markersToReload animated:(BOOL)animated completion:(dispatch_block_t _Nullable)completion;
Parameters
markersToAdd
markers that should be added
markersToRemove
markers that should be removed (compared by pointer)
markersToReload
markers that should be reloaded
animated
if
YES
modification will be animatedcompletion
block that will be called when modification is finished
-
Changes style of marker layer
Declaration
Objective-C
- (void)changeStyle:(nonnull GLMapMarkerStyleCollection *)style completion:(dispatch_block_t _Nullable)completion;
Parameters
style
New style
completion
block that will be called when modification is finished
-
Searchs nearest object or cluster of objects at given mapView
Declaration
Objective-C
- (NSArray<id> *_Nullable)objectsAtMapView:(nonnull GLMapView *)mapView nearPoint:(GLMapPoint)point distance:(double)distanceInPoints;
Parameters
mapView
map view where layer is displayed
point
point where object(s) will be searched
distanceInPoints
maximum hit distance in points
Return Value
An array of objects that meets search criteria
-
Animation duraration
Declaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) double animationDuration;