GLMapMarkerLayer
Objective-C
@interface GLMapMarkerLayer : GLMapDrawObject
Swift
class GLMapMarkerLayer : GLMapDrawObject
GLMapMarkerLayer displays a large number of markers with a given style. It supports marker clustering.
-
Unavailable
Please use inits with data.
Default -init is disabled.
Declaration
Objective-C
- (instancetype _Nonnull)init; -
Initializes
GLMapMarkerLayerwith given markers andstyle.Declaration
Objective-C
- (nonnull instancetype) initWithMarkers:(nonnull NSArray<id> *)markers andStyles:(nonnull GLMapMarkerStyleCollection *)styleCollection clusteringRadius:(double)clusteringRadius drawOrder:(int)drawOrder;Swift
init(markers: [Any], andStyles styleCollection: GLMapMarkerStyleCollection, clusteringRadius: Double, drawOrder: Int32)Parameters
markersAn array of marker objects. Usually, you set objects with data that you need to display on the map.
styleCollectionA style collection object used to display markers.
clusteringRadiusThe radius of clustering in points (0 will disable clustering).
drawOrderThe draw order of the layer.
Return Value
A new marker layer.
-
Initializes
GLMapMarkerLayerwith a given array of vector objects andstyle. When using this constructor, the location of markers is filled from the 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;Swift
init(vectorObjects: GLMapVectorObjectArray, andStyles styleCollection: GLMapMarkerStyleCollection, clusteringRadius: Double, drawOrder: Int32)Parameters
vectorObjectsAn array of vector objects.
styleCollectionA style collection object used to display markers.
clusteringRadiusThe radius of clustering in points (0 will disable clustering).
drawOrderThe draw order of the layer.
Return Value
A new marker layer.
-
Initializes
GLMapMarkerLayerwith 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;Swift
init(vectorObjects objects: GLMapVectorObjectArray, cascadeStyle: GLMapVectorCascadeStyle, styleCollection: GLMapMarkerStyleCollection, clusteringRadius: Double, drawOrder: Int32)Parameters
objectsAn array of vector objects.
cascadeStyleA cascade style used to select an image for the marker.
styleCollectionA style collection object used to display markers.
clusteringRadiusThe radius of clustering in points (0 will disable clustering).
drawOrderThe draw order of the layer.
Return Value
A new marker layer.
-
Copies markers from another layer.
Declaration
Objective-C
- (void)copyMarkersFromLayer:(nonnull GLMapMarkerLayer *)layer;Swift
func copyMarkers(from layer: GLMapMarkerLayer)Parameters
layerAnother layer with markers to copy.
-
Adds or removes markers on the layer.
Declaration
Objective-C
- (void)add:(NSArray<id> *_Nullable)markersToAdd remove:(NSArray<id> *_Nullable)markersToRemove animated:(BOOL)animated completion:(dispatch_block_t _Nullable)completion;Swift
func add(_ markersToAdd: [Any]?, remove markersToRemove: [Any]?, animated: Bool) asyncParameters
markersToAddMarkers that should be added.
markersToRemoveMarkers that should be removed (compared by pointer).
animatedIf
YES, the modification will be animated.completionA block that will be called when the modification is finished.
-
Changes the style of the marker layer.
Declaration
Objective-C
- (void)changeStyle:(nonnull GLMapMarkerStyleCollection *)style completion:(dispatch_block_t _Nullable)completion;Swift
func changeStyle(_ style: GLMapMarkerStyleCollection) asyncParameters
styleThe new style.
completionA block that will be called when the modification is finished.
-
Searches for the nearest object or cluster of objects at a given mapView.
Declaration
Objective-C
- (NSArray<id> *_Nullable)objectsAtMapView:(nonnull GLMapView *)mapView nearPoint:(nonnull GLMapPoint *)point distance:(double)distanceInPoints;Swift
func objects(at mapView: GLMapView, nearPoint point: UnsafeMutablePointer<GLMapPoint>, distance distanceInPoints: Double) -> [Any]?Parameters
mapViewThe map view where the layer is displayed.
pointThe point where object(s) will be searched. If the return is non-null, it will be modified to the location of the cluster.
distanceInPointsThe maximum hit distance in points.
Return Value
An array of objects that meet the search criteria.
-
Checks if a marker is part of a group.
Declaration
Objective-C
- (BOOL)markerIsGrouped:(nonnull id)marker;Swift
func markerIsGrouped(_ marker: Any) -> BoolParameters
markerA marker object.
Return Value
YES if the marker is grouped.
-
Animation duration.
Declaration
Objective-C
@property double animationDuration;Swift
var animationDuration: Double { get set }
Install in Dash
GLMapMarkerLayer Class Reference