Package globus.glmap
Class GLMapVectorLayer
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapDrawObject
globus.glmap.GLMapDrawable
globus.glmap.GLMapVectorLayer
- All Implemented Interfaces:
AutoCloseable
Drawable with vector objects
-
Nested Class Summary
Nested classes/interfaces inherited from class globus.glmap.GLMapDrawable
GLMapDrawable.DrawTarget, GLMapDrawable.TransformModeNested classes/interfaces inherited from class globus.glmap.GLMapDrawObject
GLMapDrawObject.UpdateCompletion, GLMapDrawObject.UpdateResult -
Constructor Summary
ConstructorsConstructorDescriptionCreates new empty image that will be injected to mapGLMapVectorLayer(int drawOrder) Creates new empty image with given draw order -
Method Summary
Modifier and TypeMethodDescriptionvoidsetSimplification(float points) Sets the geometry simplification tolerance applied when the layer builds its draw batches for the current zoom.voidsetVectorObject(GLMapVectorObject object, GLMapVectorCascadeStyle style, GLMapDrawObject.UpdateCompletion completion) Replaces the layer's geometry with one object; seesetVectorObjects(globus.glmap.GLMapVectorObjectList, globus.glmap.GLMapVectorCascadeStyle, globus.glmap.GLMapDrawObject.UpdateCompletion)for update lifecycle details.voidsetVectorObjects(GLMapVectorObjectList objects, GLMapVectorCascadeStyle style, GLMapDrawObject.UpdateCompletion completion) Sets objects and reports one terminal outcome asynchronously on the main thread.Methods inherited from class globus.glmap.GLMapDrawable
getAngle, getDrawTarget, getHeight, getOffset, getPosition, getRotatesWithMap, getScale, getScreenBBox, getWidth, setAngle, setDrawTarget, setOffset, setPosition, setRotatesWithMap, setScale, setTransformModeMethods inherited from class globus.glmap.GLMapDrawObject
getDrawOrder, isHidden, setHiddenMethods inherited from class globus.glmap.GLNativeObject
close, dispose
-
Constructor Details
-
GLMapVectorLayer
public GLMapVectorLayer(int drawOrder) Creates new empty image with given draw order- Parameters:
drawOrder- Draw order used to sort objects on map
-
GLMapVectorLayer
public GLMapVectorLayer()Creates new empty image that will be injected to map
-
-
Method Details
-
setSimplification
public void setSimplification(float points) Sets the geometry simplification tolerance applied when the layer builds its draw batches for the current zoom. The default of 1.5 points trims large objects; 0 keeps every vertex, for example when the objects come from the map itself (GLSearch.VisiblePolygonFragments) and must match the drawn geometry exactly.- Parameters:
points- tolerance in points, 0 disables simplification
-
setVectorObject
@MainThread public void setVectorObject(@NonNull GLMapVectorObject object, @NonNull GLMapVectorCascadeStyle style, @Nullable GLMapDrawObject.UpdateCompletion completion) Replaces the layer's geometry with one object; seesetVectorObjects(globus.glmap.GLMapVectorObjectList, globus.glmap.GLMapVectorCascadeStyle, globus.glmap.GLMapDrawObject.UpdateCompletion)for update lifecycle details.- Parameters:
object- vector geometry to display instead of the layer's current contentsstyle- cascade style used to prepare the geometry for drawingcompletion- optional terminal-outcome callback delivered asynchronously on the main thread; null to omit the callback
-
setVectorObjects
@MainThread public void setVectorObjects(@NonNull GLMapVectorObjectList objects, @NonNull GLMapVectorCascadeStyle style, @Nullable GLMapDrawObject.UpdateCompletion completion) Sets objects and reports one terminal outcome asynchronously on the main thread. Submit on the main thread. Native references are retained before this method returns, so the submitted list may be closed immediately (the retained objects must not be mutated concurrently). A request replaced before its build starts is Superseded. A running build may finish before the next request. Removing the layer or losing its surface cancels outstanding requests. Cancelling preparation cancels the request being prepared. A detached layer or a paused map keeps its request pending until drawing resumes, the request is superseded, or the layer is released. Ready means batches were installed, not that a frame was presented. Cancellation does not clear stored geometry; reattaching or resuming may rebuild it without another callback for the cancelled request. Failed reports disposed native inputs or an exception during preparation; previously installed batches are preserved.- Parameters:
objects- vector geometries to display instead of the layer's current contents; the list may be closed after this call returnsstyle- cascade style used to prepare the geometries for drawingcompletion- optional terminal-outcome callback delivered asynchronously on the main thread; null to omit the callback
-