Package globus.glmap
Class GLMapVectorObjectList
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapVectorObjectList
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPoint(long index, double lat, double lon) Inserts a point object into the list at the given index.cluster(double radiusInMeters) Cluster array with radiusReturns first object that hastagset tovalue.findNearPoint(long startIndex, long endIndex, GLMapViewRenderer mapView, MapPoint point, double distanceInPoints) Returns an object that is near the given point.get(long index) Returns object at the indexgetBBox()Calculates bbox of all objects in listlongindexOf(GLMapVectorObject object) Returns index of objectvoidinsertObject(long index, GLMapVectorObject object) Inserts object at indexvoidremove(long index) Removes object at the indexvoidsetObjectTag(long index, String tag, String value) Sets tag for given objectvoidsetObjectTagTruncated(long index, String tag, String value, int lineMaxLen, int maxLines) Truncates value and sets result for given objectlongsize()Returns size of listtoArray()Creates an array of GLMapVectorObjectbooleanupdatePoint(long index, double lat, double lon) Updates coordinates of an existing point object.Methods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLMapVectorObjectList
public GLMapVectorObjectList()Constructor of empty list
-
-
Method Details
-
getBBox
Calculates bbox of all objects in list- Returns:
- bbox of all objects in list
-
toArray
Creates an array of GLMapVectorObject- Returns:
- array of GLMapVectorObject
-
size
public long size()Returns size of list- Returns:
- size of list
-
get
Returns object at the index- Parameters:
index- index of object to return- Returns:
- GLMapVectorObject at given index
-
find
Returns first object that hastagset tovalue.- Parameters:
tag- tag to checkvalue- value to check- Returns:
- first matching object, or
nullif none found
-
indexOf
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
startIndexdown toendIndex. To perform reverse search,startIndexcan be greater thanendIndex.- Parameters:
startIndex- start index of search rangeendIndex- end index of search rangemapView- 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
nullif nothing is within the given distance
-
insertObject
Inserts object at index- Parameters:
index- insertion indexobject- 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 insertedlat- latitude of point in degreeslon- 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 modifylat- latitude of point in degreeslon- 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
Sets tag for given object- Parameters:
index- index of objecttag- tag to setvalue- 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 objecttag- tag to setvalue- value to setlineMaxLen- maximum length of linemaxLines- maximum number of lines
-
cluster
Cluster array with radius- Parameters:
radiusInMeters- radius of clusters in meters- Returns:
- clusters
-