-
public class ScaleBarOptionsBuilder class from which a scale bar is created.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classScaleBarOptions.LocaleUnitResolverHelper class to determine the user measuring system.
Currently supports differentiating between metric vs imperial system.
Depends on getDefault which returns the locale used at application startup.
-
Field Summary
Fields Modifier and Type Field Description public final static intREFRESH_INTERVAL_DEFAULTprivate intrefreshIntervalprivate inttextColorprivate intprimaryColorprivate intsecondaryColorprivate floatmarginTopprivate floatmarginLeftprivate floattextBarMarginprivate floatbarHeightprivate floatborderWidthprivate floattextSizeprivate booleanshowTextBorderprivate floattextBorderWidth
-
Constructor Summary
Constructors Constructor Description ScaleBarOptions(Context context)
-
Method Summary
Modifier and Type Method Description ScaleBarOptionssetRefreshInterval(int refreshInterval)Set plugin's minimum refresh interval,default value is REFRESH_INTERVAL_DEFAULT. ScaleBarOptionssetTextColor(@ColorRes() int textColor)Set the text color on scale bar,default value is android.R.color.black. ScaleBarOptionssetPrimaryColor(@ColorRes() 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. ScaleBarOptionssetSecondaryColor(@ColorRes() 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. ScaleBarOptionssetMarginTop(float marginTop)Set the margin between scale bar and the top of mapView. ScaleBarOptionssetMarginLeft(float marginLeft)Set the left margin between scale bar and mapView. ScaleBarOptionssetTextBarMargin(float textBarMargin)Set the margin between text and blocks inside scale bar. ScaleBarOptionssetBarHeight(float barHeight)Set the height for blocks in scale bar. ScaleBarOptionssetBorderWidth(float borderWidth)Set the border width in scale bar. ScaleBarOptionssetTextSize(float textSize)Set the text size of scale bar. ScaleBarOptionssetShowTextBorder(boolean showTextBorder)Set whether to show the text border. ScaleBarOptionssetTextBorderWidth(@DimenRes() int textBorderWidth)Set the border width for texts in scale bar. ScaleBarOptionssetMetricUnit(boolean metricUnit)Set whether to use metric unit or not. ScaleBarOptionssetMaxWidthRatio(@FloatRange(from = 0.1f, to = 1.0f) float ratio)Set the ratio of scale bar max width compared with MapView width. -
-
Constructor Detail
-
ScaleBarOptions
ScaleBarOptions(Context context)
-
-
Method Detail
-
setRefreshInterval
ScaleBarOptions setRefreshInterval(int refreshInterval)
Set plugin's minimum refresh interval,default value is REFRESH_INTERVAL_DEFAULT.
- Parameters:
refreshInterval- the min refresh interval, in millisecond.
-
setTextColor
ScaleBarOptions setTextColor(@ColorRes() int textColor)
Set the text color on scale bar,default value is android.R.color.black.
- Parameters:
textColor- the text color on scale bar.
-
setPrimaryColor
ScaleBarOptions setPrimaryColor(@ColorRes() 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.
- Parameters:
primaryColor- the primary color of the scale bar.
-
setSecondaryColor
ScaleBarOptions setSecondaryColor(@ColorRes() 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.
- Parameters:
secondaryColor- the secondaryColor color of the scale bar.
-
setMarginTop
ScaleBarOptions setMarginTop(float marginTop)
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.
-
setMarginLeft
ScaleBarOptions setMarginLeft(float marginLeft)
Set the left margin between scale bar and mapView.
- Parameters:
marginLeft- the left margin between scale bar and mapView, in pixel.
-
setTextBarMargin
ScaleBarOptions setTextBarMargin(float textBarMargin)
Set the margin between text and blocks inside scale bar.
- Parameters:
textBarMargin- the margin between text and blocks inside scale bar, in pixel.
-
setBarHeight
ScaleBarOptions setBarHeight(float barHeight)
Set the height for blocks in scale bar.
- Parameters:
barHeight- the height for blocks in scale bar, in pixel.
-
setBorderWidth
ScaleBarOptions setBorderWidth(float borderWidth)
Set the border width in scale bar.
- Parameters:
borderWidth- the border width in scale bar, in pixel.
-
setTextSize
ScaleBarOptions setTextSize(float textSize)
Set the text size of scale bar.
- Parameters:
textSize- the text size of scale bar, in pixel.
-
setShowTextBorder
ScaleBarOptions setShowTextBorder(boolean showTextBorder)
Set whether to show the text border.
- Parameters:
showTextBorder- whether to show the text border or not.
-
setTextBorderWidth
ScaleBarOptions setTextBorderWidth(@DimenRes() int textBorderWidth)
Set the border width for texts in scale bar.
- Parameters:
textBorderWidth- the border width for texts in scale bar, in dp.
-
setMetricUnit
ScaleBarOptions setMetricUnit(boolean metricUnit)
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.
-
setMaxWidthRatio
ScaleBarOptions setMaxWidthRatio(@FloatRange(from = 0.1f, to = 1.0f) float ratio)
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.
-
-
-
-