Package globus.glmap
Class GLMapBalloon
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapDrawObject
globus.glmap.GLMapDrawable
globus.glmap.GLMapBalloon
Drawable that displays text in balloon.
-
Nested Class Summary
Nested classes/interfaces inherited from class globus.glmap.GLMapDrawable
GLMapDrawable.TransformMode -
Constructor Summary
ConstructorsConstructorDescriptionGLMapBalloon(int drawOrder) Creates a new balloon with the given draw order. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetBackgroundBitmap(android.graphics.Bitmap bitmap, android.graphics.Rect insets) Sets the background image of the balloon.voidsetPlaceToCenter(boolean placeToCenter) If set totrue, the position nearest to the center of the screen will be selected.voidsetPossiblePositions(double[] positions) Sets candidate positions where the balloon can be displayed.voidsetReferenceAngle(float referenceAngle) Sets reference angle to detect direction of balloonvoidsetText(String text, GLMapVectorStyle style, android.graphics.Rect insets, Runnable onReadyToDraw) Sets the text of the balloon.Methods inherited from class globus.glmap.GLMapDrawable
getAngle, getHeight, getOffset, getPosition, getScale, getWidth, hitTest, isRotatesWithMap, setAngle, setOffset, setPosition, setRotatesWithMap, setScale, setTransformModeMethods inherited from class globus.glmap.GLMapDrawObject
getDrawOrder, isHidden, setHiddenMethods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLMapBalloon
public GLMapBalloon(int drawOrder) Creates a new balloon with the given draw order.- Parameters:
drawOrder- Draw order used to sort objects on map
-
-
Method Details
-
setBackgroundBitmap
public void setBackgroundBitmap(@NonNull android.graphics.Bitmap bitmap, @Nullable android.graphics.Rect insets) Sets the background image of the balloon.- Parameters:
bitmap- image to setinsets- insets of background image
-
setText
public void setText(@NonNull String text, @NonNull GLMapVectorStyle style, @Nullable android.graphics.Rect insets, @Nullable Runnable onReadyToDraw) Sets the text of the balloon.- Parameters:
text- new text to drawstyle- style of the textinsets- insets of textonReadyToDraw- optional runnable that called when text ready to draw
-
setReferenceAngle
public void setReferenceAngle(float referenceAngle) Sets reference angle to detect direction of balloon- Parameters:
referenceAngle- reference angle
-
setPossiblePositions
public void setPossiblePositions(double[] positions) Sets candidate positions where the balloon can be displayed.- Parameters:
positions- flattened array[x1, y1, dx1, dy1, x2, y2, dx2, dy2, ...], where(x, y)is position in internal map coordinates and(dx, dy)is a normalized direction vector
-
setPlaceToCenter
public void setPlaceToCenter(boolean placeToCenter) If set totrue, the position nearest to the center of the screen will be selected.- Parameters:
placeToCenter- value to set
-