public class ScaleBarOptions extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ScaleBarOptions.LocaleUnitResolver
Helper class to determine the user measuring system.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
REFRESH_INTERVAL_DEFAULT |
| Constructor and Description |
|---|
ScaleBarOptions(Context context) |
| Modifier and Type | Method and Description |
|---|---|
ScaleBarOptions |
setBarHeight(float barHeight)
Set the height for blocks in scale bar.
|
ScaleBarOptions |
setBarHeight(int barHeight)
Set the height for blocks in scale bar.
|
ScaleBarOptions |
setBorderWidth(float borderWidth)
Set the border width in scale bar.
|
ScaleBarOptions |
setBorderWidth(int borderWidth)
Set the border width in scale bar.
|
ScaleBarOptions |
setMarginLeft(float marginLeft)
Set the left margin between scale bar and mapView.
|
ScaleBarOptions |
setMarginLeft(int marginLeft)
Set the left margin between scale bar and mapView.
|
ScaleBarOptions |
setMarginTop(float marginTop)
Set the margin between scale bar and the top of mapView.
|
ScaleBarOptions |
setMarginTop(int marginTop)
Set the margin between scale bar and the top of mapView.
|
ScaleBarOptions |
setMaxWidthRatio(float ratio)
Set the ratio of scale bar max width compared with MapView width.
|
ScaleBarOptions |
setMetricUnit(boolean metricUnit)
Set whether to use metric unit or not.
|
ScaleBarOptions |
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.
|
ScaleBarOptions |
setRefreshInterval(int refreshInterval)
Set plugin's minimum refresh interval,
default value is
REFRESH_INTERVAL_DEFAULT. |
ScaleBarOptions |
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.
|
ScaleBarOptions |
setTextBarMargin(float textBarMargin)
Set the margin between text and blocks inside scale bar.
|
ScaleBarOptions |
setTextBarMargin(int textBarMargin)
Set the margin between text and blocks inside scale bar.
|
ScaleBarOptions |
setTextColor(int textColor)
Set the text color on scale bar,
default value is android.R.color.black.
|
ScaleBarOptions |
setTextSize(float textSize)
Set the text size of scale bar.
|
ScaleBarOptions |
setTextSize(int textSize)
Set the text size of scale bar.
|
public static final int REFRESH_INTERVAL_DEFAULT
public ScaleBarOptions(Context context)
public ScaleBarOptions setRefreshInterval(int refreshInterval)
REFRESH_INTERVAL_DEFAULT.refreshInterval - the min refresh interval, in millisecond.public ScaleBarOptions setTextColor(int textColor)
textColor - the text color on scale bar.public ScaleBarOptions setPrimaryColor(int primaryColor)
primaryColor - the primary color of the scale bar.public ScaleBarOptions setSecondaryColor(int secondaryColor)
secondaryColor - the secondaryColor color of the scale bar.public ScaleBarOptions setMarginTop(float marginTop)
marginTop - the margin between scale bar and the top of mapView, in pixel.public ScaleBarOptions setMarginTop(int marginTop)
marginTop - the margin between scale bar and the top of mapView, in dp.public ScaleBarOptions setBarHeight(float barHeight)
barHeight - the height for blocks in scale bar, in pixel.public ScaleBarOptions setBarHeight(int barHeight)
barHeight - the height for blocks in scale bar, in dp.public ScaleBarOptions setBorderWidth(float borderWidth)
borderWidth - the border width in scale bar, in pixel.public ScaleBarOptions setBorderWidth(int borderWidth)
borderWidth - the border width in scale bar, in dp.public ScaleBarOptions setTextSize(float textSize)
textSize - the text size of scale bar, in pixel.public ScaleBarOptions setTextSize(int textSize)
textSize - the text size of scale bar, in dp.public ScaleBarOptions setMetricUnit(boolean metricUnit)
metricUnit - whether to use metric unit or not.public ScaleBarOptions setMarginLeft(float marginLeft)
marginLeft - the left margin between scale bar and mapView, in pixel.public ScaleBarOptions setMarginLeft(int marginLeft)
marginLeft - the left margin between scale bar and mapView, in dp.public ScaleBarOptions setTextBarMargin(float textBarMargin)
textBarMargin - the margin between text and blocks inside scale bar, in pixel.public ScaleBarOptions setTextBarMargin(int textBarMargin)
textBarMargin - the margin between text and blocks inside scale bar, in dp.public ScaleBarOptions setMaxWidthRatio(float ratio)
ratio - the ratio scale bar will use, must be in the range from 0.1f to 1.0f.© 2015–2019 Mapbox. All rights reserved.