public class

MarkerStyleBuilder

extends BillboardStyleBuilder
java.lang.Object
   ↳ com.carto.styles.StyleBuilder
     ↳ com.carto.styles.BillboardStyleBuilder
       ↳ com.carto.styles.MarkerStyleBuilder

Class Overview

A builder class for MarkerStyle.

Summary

Public Constructors
MarkerStyleBuilder()
Constructs a MarkerStyleBuilder object with all parameters set to defaults.
Public Methods
MarkerStyle buildStyle()
Builds a new instance of the MarkerStyle object using previously set parameters.
synchronized void delete()
float getAnchorPointX()
Returns the horizontal anchor point of the marker.
float getAnchorPointY()
Returns the vertical anchor point of the marker.
Bitmap getBitmap()
Returns the bitmap of the marker.
float getClickSize()
Returns the size of the marker used for click detection.
BillboardOrientation getOrientationMode()
Returns the orientation mode of the marker.
BillboardScaling getScalingMode()
Returns the scaling mode of the marker.
float getSize()
Returns the size of the marker.
void setAnchorPoint(float anchorPointX, float anchorPointY)
Sets the anchor point for the marker.
void setAnchorPointX(float anchorPointX)
Sets the horizontal anchor point of the marker.
void setAnchorPointY(float anchorPointY)
Sets the vertical anchor point of the marker.
void setBitmap(Bitmap bitmap)
Sets the bitmap that will be used for drawing the marker.
void setClickSize(float size)
Sets the size for the marker that will be used for click detection.
void setOrientationMode(BillboardOrientation orientationMode)
Sets the orientation mode for the marker.
void setScalingMode(BillboardScaling scalingMode)
Sets the scaling mode for the marker.
void setSize(float size)
Sets the size for the marker.
[Expand]
Inherited Methods
From class com.carto.styles.BillboardStyleBuilder
From class com.carto.styles.StyleBuilder
From class java.lang.Object

Public Constructors

public MarkerStyleBuilder ()

Constructs a MarkerStyleBuilder object with all parameters set to defaults.

Public Methods

public MarkerStyle buildStyle ()

Builds a new instance of the MarkerStyle object using previously set parameters.

Returns
  • A new MarkerStyle object.

public synchronized void delete ()

public float getAnchorPointX ()

Returns the horizontal anchor point of the marker.

Returns
  • The horizontal anchor point of the marker.

public float getAnchorPointY ()

Returns the vertical anchor point of the marker.

Returns
  • The vertical anchor point of the marker.

public Bitmap getBitmap ()

Returns the bitmap of the marker.

Returns
  • The bitmap of the marker.

public float getClickSize ()

Returns the size of the marker used for click detection.

Returns
  • The size of the marker used for click detection.

public BillboardOrientation getOrientationMode ()

Returns the orientation mode of the marker.

Returns
  • The orientation mode of the marker.

public BillboardScaling getScalingMode ()

Returns the scaling mode of the marker.

Returns
  • The scaling mode of the marker.

public float getSize ()

Returns the size of the marker.

Returns
  • The size of the marker, units depend on the scaling mode.

public void setAnchorPoint (float anchorPointX, float anchorPointY)

Sets the anchor point for the marker. Values will be clamped to [-1, 1] range.

Parameters
anchorPointX The new horizontal anchor point for the marker. -1 means the left side,
0 the center and 1 the right side of the marker. The default is 0.
anchorPointY The vertical anchor point for the marker. -1 means the bottom,
0 the center and 1 the top of the marker. The default is -1.

public void setAnchorPointX (float anchorPointX)

Sets the horizontal anchor point of the marker.

Parameters
anchorPointX The new horizontal anchor point for the marker. -1 means the left side,
0 the center and 1 the right side of the marker. The default is 0.

public void setAnchorPointY (float anchorPointY)

Sets the vertical anchor point of the marker.

Parameters
anchorPointY The vertical anchor point for the marker. -1 means the bottom,
0 the center and 1 the top of the marker. The default is -1.

public void setBitmap (Bitmap bitmap)

Sets the bitmap that will be used for drawing the marker. The default is "default_marker.png".

Parameters
bitmap The new bitmap for the marker.

public void setClickSize (float size)

Sets the size for the marker that will be used for click detection.
Units are screen density independent pixels (DP or DIP). If set to -1 the click size will be
calculated automatically. The default is -1.

Parameters
size The new point size in dp.

public void setOrientationMode (BillboardOrientation orientationMode)

Sets the orientation mode for the marker. The default is BillboardOrientation::FACE_CAMERA_BILLBOARD.

Parameters
orientationMode The new orientation mode for the marker.

public void setScalingMode (BillboardScaling scalingMode)

Sets the scaling mode for the marker. The default is BillboardScaling::CONST_SCREEN_SIZE.

Parameters
scalingMode The new scaling mode for the marker.

public void setSize (float size)

Sets the size for the marker. The units depend on the scaling mode, if it's set to BillboardScaling::WORLD_SIZE,
the size is in meters near the equator, the size will not be stretched near the poles. If it's set to
BillboardScaling::SCREEN_SIZE or BillboardScaling::CONST_SCREEN_SIZE then the size is in screen density
independent pixels (dp or dip) or normal pixels, depending whether setScaleWithDPI was set to true or false
respectively. If set to -1, unpadded bitmap width will be used instead. The default is -1.

Parameters
size The new marker size.