Package globus.glmap

Class GLMapMarkerLayer

java.lang.Object

@ParametersAreNonnullByDefault
public class GLMapMarkerLayer
extends GLMapDrawObject
GLMapMarkerLayer displays 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)
    Initializes GLMapMarkerLayer with given vector objects and `style`
    GLMapMarkerLayer​(java.lang.Object[] markers, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder)
    Initializes GLMapMarkerLayer with given markers and `styleCollection`
  • Method Summary

    Modifier and Type Method Description
    void changeStyle​(GLMapMarkerStyleCollection styleCollection)
    Change style of layer
    boolean haveObject​(java.lang.Object marker)
    Checks if given marker is added to layer
    void modify​(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 layer
    java.lang.Object[] objectsNearPoint​(GLMapView 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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GLMapMarkerLayer

      public GLMapMarkerLayer​(@Nullable java.lang.Object[] markers, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder)
      Initializes GLMapMarkerLayer 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 map
      clusteringRadius - Radius of clustering in points. If 0 marker clustering will be disabled
    • GLMapMarkerLayer

      public GLMapMarkerLayer​(GLMapVectorObjectList objects, GLMapVectorCascadeStyle cascadeStyle, GLMapMarkerStyleCollection styleCollection, double clusteringRadius, int drawOrder)
      Initializes GLMapMarkerLayer 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 unions
      styleCollection - A style collection object used to display markers.
      drawOrder - Draw order used to sort objects on map
      clusteringRadius - Radius of clustering in points. If 0 marker clustering will be disabled
  • Method Details

    • objectsNearPoint

      @Nullable public java.lang.Object[] objectsNearPoint​(GLMapView 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.
      Parameters:
      mapView - map view where layer is displayed
      point - point where object(s) will be searched
      distanceInPoints - 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 added
      markersToRemove - markers that should be removed
      markersToReload - markers that should be reloaded
      animated - deleting or adding single markers will be animated
      onComplete - called when operation is finished
    • changeStyle

      public void changeStyle​(GLMapMarkerStyleCollection styleCollection)
      Change style of layer
      Parameters:
      styleCollection - new style for layer