Package globus.glmap
Class GLMapVectorObjectList
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapVectorObjectList
GLMapVectorObject
is a bridge class, to work with GLMap internal representation of
array of vector object.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addPoint
(long index, double lat, double lon) Adds point to listcluster
(double radiusInMeters) Cluster array with radiusReturns first object that have `tag` set to `value`findNearPoint
(long startIndex, long endIndex, GLMapViewRenderer mapView, MapPoint point, double distanceInPoints) Returns object that is near point.get
(long index) Returns object at the indexgetBBox()
Calculates bbox of all objects in listlong
indexOf
(GLMapVectorObject object) Returns index of objectvoid
insertObject
(long index, GLMapVectorObject object) Inserts object at indexvoid
remove
(long index) Removes object at the indexvoid
setObjectTag
(long index, String tag, String value) Sets tag for given objectvoid
setObjectTagTruncated
(long index, String tag, String value, int lineMaxLen, int maxLines) Truncates value and sets result for given objectlong
size()
Returns size of listtoArray()
Creates an array of GLMapVectorObjectboolean
updatePoint
(long index, double lat, double lon) Sets new location of pointMethods 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 have `tag` set to `value`- Parameters:
tag
- tag to checkvalue
- value to check- Returns:
- first object that have `tag` set to `value`
-
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 object that is near point. Search runs from startIndex down to endIndex. To perform reverse search startIndex can be greater then endIndex.- Parameters:
startIndex
- start index of search rangeendIndex
- end index of search rangemapView
- MapView where objects are displayedpoint
- Point from where calculate nearest point. On success will contain nearest point of returned objectdistanceInPoints
- maximum distance from track in points- Returns:
- last object that is near point
-
insertObject
Inserts object at index- Parameters:
index
- insertion indexobject
- object to insert
-
addPoint
public boolean addPoint(long index, double lat, double lon) Adds point to list- Parameters:
index
- index where new object will be insertedlat
- latitude of pointlon
- longitude of point- Returns:
- true if success
-
updatePoint
public boolean updatePoint(long index, double lat, double lon) Sets new location of point- Parameters:
index
- index of point to modifylat
- latitude of pointlon
- longitude of point- 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
-