Package globus.glmap
Class GLMapMarkerLayer
- java.lang.Object
-
- globus.glmap.GLNativeObject
-
- globus.glmap.GLMapDrawObject
-
- globus.glmap.GLMapMarkerLayer
-
public class GLMapMarkerLayer extends GLMapDrawObject
GLMapMarkerLayerdisplays a markers with given style. It could display thousands of markers and optionally cluster them.
-
-
Constructor Summary
Constructors Constructor Description GLMapMarkerLayer(GLMapVectorObjectList objects, GLMapVectorCascadeStyle cascadeStyle, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder)InitializesGLMapMarkerLayerwith given vector objects and `style`GLMapMarkerLayer(java.lang.Object[] markers, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder)InitializesGLMapMarkerLayerwith given markers and `styleCollection`
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeStyle(GLMapMarkerStyleCollection styleCollection)Change style of layerbooleanhaveObject(java.lang.Object marker)Checks if given marker is added to layervoidmodify(java.lang.Object[] newMarkers, java.util.Set<java.lang.Object> markersToRemove, java.util.Set<java.lang.Object> markersToReload, boolean animated, java.lang.Runnable onComplete)Adds or removes markers on layerjava.lang.Object[]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.-
Methods inherited from class globus.glmap.GLMapDrawObject
getDrawOrder, isHidden, setHidden
-
Methods inherited from class globus.glmap.GLNativeObject
dispose
-
-
-
-
Constructor Detail
-
GLMapMarkerLayer
public GLMapMarkerLayer(@Nullable java.lang.Object[] markers, @NonNull GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder)InitializesGLMapMarkerLayerwith 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)InitializesGLMapMarkerLayerwith 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 Detail
-
objectsNearPoint
@Nullable public java.lang.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
public boolean haveObject(java.lang.Object marker)
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 java.lang.Object[] newMarkers, @Nullable java.util.Set<java.lang.Object> markersToRemove, @Nullable java.util.Set<java.lang.Object> markersToReload, boolean animated, @Nullable java.lang.Runnable onComplete)Adds or removes markers on layer- Parameters:
newMarkers- markers that should be addedmarkersToRemove- markers that should be removedmarkersToReload- markers that should be reloadedanimated- deleting or adding single markers will be animatedonComplete- called when operation is finished
-
changeStyle
public void changeStyle(@NonNull GLMapMarkerStyleCollection styleCollection)Change style of layer- Parameters:
styleCollection- new style for layer
-
-