Package globus.glmap

Class GLMapVectorObjectList

java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapVectorObjectList

public class GLMapVectorObjectList extends GLNativeObject
A bridge container for a native list of GLMapVectorObject instances.

The list is backed by native storage and provides basic querying and mutation APIs.

  • Constructor Details

    • GLMapVectorObjectList

      public GLMapVectorObjectList()
      Constructor of empty list
  • Method Details

    • getBBox

      @NonNull public GLMapBBox getBBox()
      Calculates bbox of all objects in list
      Returns:
      bbox of all objects in list
    • toArray

      @NonNull public GLMapVectorObject[] toArray()
      Creates an array of GLMapVectorObject
      Returns:
      array of GLMapVectorObject
    • size

      public long size()
      Returns size of list
      Returns:
      size of list
    • get

      @NonNull public GLMapVectorObject get(long index)
      Returns object at the index
      Parameters:
      index - index of object to return
      Returns:
      GLMapVectorObject at given index
    • find

      @Nullable public GLMapVectorObject find(@NonNull String tag, @NonNull String value)
      Returns first object that has tag set to value.
      Parameters:
      tag - tag to check
      value - value to check
      Returns:
      first matching object, or null if none found
    • indexOf

      public long indexOf(@Nullable GLMapVectorObject object)
      Returns index of object
      Parameters:
      object - object to search
      Returns:
      index of object or -1
    • findNearPoint

      @Nullable public GLMapVectorObject findNearPoint(long startIndex, long endIndex, @NonNull GLMapViewRenderer mapView, @NonNull MapPoint point, double distanceInPoints)
      Returns an object that is near the given point.

      The search runs from startIndex down to endIndex. To perform reverse search, startIndex can be greater than endIndex.

      Parameters:
      startIndex - start index of search range
      endIndex - end index of search range
      mapView - renderer where objects are displayed (must be attached to a surface to compute screen distances)
      point - input: reference point in internal map coordinates; output: nearest point on the returned object (only valid when return value is non-null)
      distanceInPoints - maximum distance from the object in screen points (dp)
      Returns:
      the last object that is near the point, or null if nothing is within the given distance
    • insertObject

      public void insertObject(long index, GLMapVectorObject object)
      Inserts object at index
      Parameters:
      index - insertion index
      object - object to insert
    • addPoint

      public boolean addPoint(long index, double lat, double lon)
      Inserts a point object into the list at the given index.
      Parameters:
      index - index where new object will be inserted
      lat - latitude of point in degrees
      lon - longitude of point in degrees
      Returns:
      true if success
    • updatePoint

      public boolean updatePoint(long index, double lat, double lon)
      Updates coordinates of an existing point object.
      Parameters:
      index - index of point to modify
      lat - latitude of point in degrees
      lon - longitude of point in degrees
      Returns:
      true if success
    • remove

      public void remove(long index)
      Removes object at the index
      Parameters:
      index - index of object to remove
    • setObjectTag

      public void setObjectTag(long index, @NonNull String tag, @Nullable String value)
      Sets tag for given object
      Parameters:
      index - index of object
      tag - tag to set
      value - value to set
    • setObjectTagTruncated

      public void setObjectTagTruncated(long index, @NonNull String tag, @Nullable String value, int lineMaxLen, int maxLines)
      Truncates value and sets result for given object
      Parameters:
      index - index of object
      tag - tag to set
      value - value to set
      lineMaxLen - maximum length of line
      maxLines - maximum number of lines
    • cluster

      public GLMapVectorObjectList[] cluster(double radiusInMeters)
      Cluster array with radius
      Parameters:
      radiusInMeters - radius of clusters in meters
      Returns:
      clusters