Class ScaleBarOptions
java.lang.Object
com.trimblemaps.mapsdk.plugins.scalebar.ScaleBarOptions
Builder class from which a scale bar is created.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper class to determine the user measuring system. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetBarHeight(float barHeight) Set the height for blocks in scale bar.setBarHeight(int barHeight) Set the height for blocks in scale bar.setBorderWidth(float borderWidth) Set the border width in scale bar.setBorderWidth(int borderWidth) Set the border width in scale bar.setMarginLeft(float marginLeft) Set the left margin between scale bar and mapView.setMarginLeft(int marginLeft) Set the left margin between scale bar and mapView.setMarginTop(float marginTop) Set the margin between scale bar and the top of mapView.setMarginTop(int marginTop) Set the margin between scale bar and the top of mapView.setMaxWidthRatio(float ratio) Set the ratio of scale bar max width compared with MapView width.setMetricUnit(boolean metricUnit) Set whether to use metric unit or not.setPrimaryColor(int primaryColor) Set the primary color of the scale bar, will be used to draw odd index blocks, default value is android.R.color.black.setRefreshInterval(int refreshInterval) Set plugin's minimum refresh interval, default value isREFRESH_INTERVAL_DEFAULT.setSecondaryColor(int secondaryColor) Set the secondary color of the scale bar, will be used to draw even index blocks, default value is android.R.color.white.setShowTextBorder(boolean showTextBorder) Set whether to show the text border.setTextBarMargin(float textBarMargin) Set the margin between text and blocks inside scale bar.setTextBarMargin(int textBarMargin) Set the margin between text and blocks inside scale bar.setTextBorderWidth(float textBorderWidth) Set the border width for texts in scale bar.setTextBorderWidth(int textBorderWidth) Set the border width for texts in scale bar.setTextColor(int textColor) Set the text color on scale bar, default value is android.R.color.black.setTextSize(float textSize) Set the text size of scale bar.setTextSize(int textSize) Set the text size of scale bar.
-
Field Details
-
REFRESH_INTERVAL_DEFAULT
public static final int REFRESH_INTERVAL_DEFAULT- See Also:
-
-
Constructor Details
-
ScaleBarOptions
public ScaleBarOptions(@NonNull android.content.Context context)
-
-
Method Details
-
setRefreshInterval
Set plugin's minimum refresh interval, default value isREFRESH_INTERVAL_DEFAULT.- Parameters:
refreshInterval- the min refresh interval, in millisecond.- Returns:
- this
-
setTextColor
Set the text color on scale bar, default value is android.R.color.black.- Parameters:
textColor- the text color on scale bar.- Returns:
- this.
-
setPrimaryColor
Set the primary color of the scale bar, will be used to draw odd index blocks, default value is android.R.color.black.- Parameters:
primaryColor- the primary color of the scale bar.- Returns:
- this.
-
setSecondaryColor
Set the secondary color of the scale bar, will be used to draw even index blocks, default value is android.R.color.white.- Parameters:
secondaryColor- the secondaryColor color of the scale bar.- Returns:
- this.
-
setMarginTop
Set the margin between scale bar and the top of mapView.- Parameters:
marginTop- the margin between scale bar and the top of mapView, in pixel.- Returns:
- this.
-
setMarginTop
Set the margin between scale bar and the top of mapView.- Parameters:
marginTop- the margin between scale bar and the top of mapView, in dp.- Returns:
- this.
-
setBarHeight
Set the height for blocks in scale bar.- Parameters:
barHeight- the height for blocks in scale bar, in pixel.- Returns:
- this.
-
setBarHeight
Set the height for blocks in scale bar.- Parameters:
barHeight- the height for blocks in scale bar, in dp.- Returns:
- this.
-
setBorderWidth
Set the border width in scale bar.- Parameters:
borderWidth- the border width in scale bar, in pixel.- Returns:
- this.
-
setBorderWidth
Set the border width in scale bar.- Parameters:
borderWidth- the border width in scale bar, in dp.- Returns:
- this.
-
setTextBorderWidth
Set the border width for texts in scale bar.- Parameters:
textBorderWidth- the border width for texts in scale bar, in dp.- Returns:
- this.
-
setTextBorderWidth
Set the border width for texts in scale bar.- Parameters:
textBorderWidth- the border width for texts in scale bar, in pixel.- Returns:
- this.
-
setShowTextBorder
Set whether to show the text border.- Parameters:
showTextBorder- whether to show the text border or not.- Returns:
- this.
-
setTextSize
Set the text size of scale bar.- Parameters:
textSize- the text size of scale bar, in pixel.- Returns:
- this.
-
setTextSize
Set the text size of scale bar.- Parameters:
textSize- the text size of scale bar, in dp.- Returns:
- this.
-
setMetricUnit
Set whether to use metric unit or not. The default value is depends on settings of device.- Parameters:
metricUnit- whether to use metric unit or not.- Returns:
- this.
-
setMarginLeft
Set the left margin between scale bar and mapView.- Parameters:
marginLeft- the left margin between scale bar and mapView, in pixel.- Returns:
- this.
-
setMarginLeft
Set the left margin between scale bar and mapView.- Parameters:
marginLeft- the left margin between scale bar and mapView, in dp.- Returns:
- this.
-
setTextBarMargin
Set the margin between text and blocks inside scale bar.- Parameters:
textBarMargin- the margin between text and blocks inside scale bar, in pixel.- Returns:
- this.
-
setTextBarMargin
Set the margin between text and blocks inside scale bar.- Parameters:
textBarMargin- the margin between text and blocks inside scale bar, in dp.- Returns:
- this.
-
setMaxWidthRatio
Set the ratio of scale bar max width compared with MapView width.- Parameters:
ratio- the ratio scale bar will use, must be in the range from 0.1f to 1.0f.
-