Package globus.glmap
Class GLMapMarkerLayer
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapDrawObject
globus.glmap.GLMapMarkerLayer
GLMapMarkerLayer
displays a markers with given style. It could display thousands of
markers and optionally cluster them.-
Constructor Summary
ConstructorDescriptionGLMapMarkerLayer
(GLMapVectorObjectList objects, GLMapVectorCascadeStyle cascadeStyle, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder) InitializesGLMapMarkerLayer
with given vector objects and `style`GLMapMarkerLayer
(Object[] markers, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder) InitializesGLMapMarkerLayer
with given markers and `styleCollection` -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeStyle
(GLMapMarkerStyleCollection styleCollection) Change style of layerboolean
haveObject
(Object marker) Checks if given marker is added to layerboolean
markerIsGrouped
(Object marker) Checks if marker is part of groupvoid
Adds or removes markers on layerObject[]
objectsNearPoint
(GLMapViewRenderer mapView, MapPoint point, double distanceInPoints) Searches nearest object or cluster of objects at given mapView Note that GLMapView must be dispalyed on screen to calculate distances.void
replace
(Object[] markers, GLMapMarkerStyleCollection styleCollection, double clusteringRadius) Replace content with new datavoid
replaceWithVectorObjects
(GLMapVectorObjectList objects, GLMapVectorCascadeStyle cascadeStyle, GLMapMarkerStyleCollection styleCollection, double clusteringRadius) InitializesGLMapMarkerLayer
with given vector objects and `style`Methods inherited from class globus.glmap.GLMapDrawObject
getDrawOrder, isHidden, setHidden
Methods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLMapMarkerLayer
public GLMapMarkerLayer(@Nullable Object[] markers, @NonNull GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder) InitializesGLMapMarkerLayer
with given markers and `styleCollection`- 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.drawOrder
- Draw order used to sort objects on mapclusteringRadius
- Radius of clustering in points. If 0 marker clustering will be disabled
-
GLMapMarkerLayer
public GLMapMarkerLayer(@NonNull GLMapVectorObjectList objects, @NonNull GLMapVectorCascadeStyle cascadeStyle, @NonNull GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder) InitializesGLMapMarkerLayer
with given vector objects and `style`- Parameters:
objects
- Array of marker objects. Usually you set objects with data, that you need to display on map.cascadeStyle
- A cascadeStyle that defines what style use for markers and unionsstyleCollection
- A style collection object used to display markers.drawOrder
- Draw order used to sort objects on mapclusteringRadius
- Radius of clustering in points. If 0 marker clustering will be disabled
-
-
Method Details
-
objectsNearPoint
@Nullable public Object[] objectsNearPoint(@NonNull GLMapViewRenderer mapView, @NonNull MapPoint point, double distanceInPoints) Searches nearest object or cluster of objects at given mapView Note that GLMapView must be dispalyed on screen to calculate distances.- Parameters:
mapView
- map view where layer is displayedpoint
- point where object(s) will be searcheddistanceInPoints
- maximum hit distance in points- Returns:
- First object or cluster distance of which is not greater that given distance
-
haveObject
Checks if given marker is added to layer- Parameters:
marker
- marker to check- Returns:
- true if object is in marker layer
-
modify
public void modify(@Nullable Object[] newMarkers, @Nullable Set<Object> markersToRemove, boolean animated, @Nullable Runnable onComplete) Adds or removes markers on layer- Parameters:
newMarkers
- markers that should be addedmarkersToRemove
- markers that should be removedanimated
- deleting or adding single markers will be animatedonComplete
- called when operation is finished
-
replace
public void replace(@Nullable Object[] markers, @NonNull GLMapMarkerStyleCollection styleCollection, double clusteringRadius) Replace content with new data- Parameters:
markers
- markers Array of marker objects.styleCollection
- A style collection object used to display markers.clusteringRadius
- Radius of clustering in points. If 0 marker clustering will be disabled
-
replaceWithVectorObjects
public void replaceWithVectorObjects(@NonNull GLMapVectorObjectList objects, @NonNull GLMapVectorCascadeStyle cascadeStyle, @NonNull GLMapMarkerStyleCollection styleCollection, double clusteringRadius) InitializesGLMapMarkerLayer
with given vector objects and `style`- Parameters:
objects
- Array of marker objects. Usually you set objects with data, that you need to display on map.cascadeStyle
- A cascadeStyle that defines what style use for markers and unionsstyleCollection
- A style collection object used to display markers.clusteringRadius
- Radius of clustering in points. If 0 marker clustering will be disabled
-
changeStyle
Change style of layer- Parameters:
styleCollection
- new style for layer
-
markerIsGrouped
Checks if marker is part of group- Parameters:
marker
- marker object- Returns:
- YES if marker is grouped
-