Package 

Class ScaleBarOptions


  • 
    public class ScaleBarOptions
    
                        

    Builder class from which a scale bar is created.

    • Constructor Detail

      • ScaleBarOptions

        ScaleBarOptions(Context context)
    • Method Detail

      • 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.