0
点赞
收藏
分享

微信扫一扫

6.6.比例尺图层(ScaleBarOverlay)

迪莉娅1979 2023-11-17 阅读 15

        通过创建这个实例并添加到MapView中后,会在地图上出现一个随着缩放等级变换的比例尺控件。

        通过其方法可进行位置、单位等等参数设置。

Modifier and TypeMethodDescription
voidsetMinZoom(double zoom)Sets the minimum zoom level for the scale bar to be drawn.
ScaleBarOverlay.UnitsOfMeasuregetUnitsOfMeasure()Gets the units of measure to be shown in the scale bar
voidsetUnitsOfMeasure(ScaleBarOverlay.UnitsOfMeasure unitsOfMeasure)Sets the units of measure to be shown in the scale bar
voidsetAlignBottom(boolean alignBottom)
voidsetAlignRight(boolean alignRight)
PaintgetBarPaint()Return's the paint used to draw the bar
voidsetBarPaint(Paint pBarPaint)Sets the paint for drawing the bar
PaintgetTextPaint()Returns the paint used to draw the text
voidsetTextPaint(Paint pTextPaint)Sets the paint for drawing the text
voidsetCentred(boolean centred)Flag to draw the bar centered around the set offset coordinates or to the right/bottom of thecoordinates (default)
voidsetMaxLength(float pMaxLengthInCm)Sets the maximum bar length.
voidsetScaleBarOffset(int x, int y)Sets the scale bar screen offset for the bar.
voidsetLineWidth(float width)Sets the bar's line width.
voidsetTextSize(float size)Sets the text size.
voiddrawLatitudeScale(boolean latitude)Latitudinal / horizontal scale bar flag
voiddrawLongitudeScale(boolean longitude)Longitudinal / vertical scale bar flag
voidsetBackgroundPaint(Paint pBgPaint)Sets the background paint.
voidsetEnableAdjustLength(boolean adjustLength)If enabled, the bar will automatically adjust the length to reflect a round number (startingwith 1, 2 or 5).
voiddraw(Canvas c, Projection projection)
voiddisableScaleBar()
voidenableScaleBar()
voidonDetach(MapView mapView)Override to perform clean up of resources before shutdown.
static StringgetScaleString(Context pContext, String pValue, GeoConstants.UnitOfMeasure pUnitOfMeasure)
举报

相关推荐

0 条评论