Module: ol/control/ScaleLine

ol/control/ScaleLine


Classes

ScaleLine

Type Definitions

Options{Object}

Properties:
Name Type Description
className string | undefined

CSS 类名。当配置 bar: true 时,默认为 ol-scale-bar。 否则默认为 ol-scale-line

minWidth number
(defaults to 64)

OGC 默认 dpi 下的最小宽度(像素)。宽度将根据使用的 dpi 进行调整。

maxWidth number | undefined

OGC 默认 dpi 下的最大宽度(像素)。宽度将根据使用的 dpi 进行调整。

render function | undefined

控件需要重新渲染时调用的函数。 此函数在 requestAnimationFrame 回调中调用。

target HTMLElement | string | undefined

如果希望控件在地图视口之外渲染,请指定目标。

units Units
(defaults to 'metric')

单位。

bar boolean
(defaults to false)

渲染比例尺条而非线条。

steps number
(defaults to 4)

比例尺条使用的步数。使用偶数效果最佳。仅在 bartrue 时适用。

text boolean
(defaults to false)

在比例尺条上方渲染文本比例尺。仅在 bartrue 时适用。

dpi number | undefined

输出设备(如打印机)的 dpi。仅在 bartrue 时适用。如果未定义,将假定 OGC 默认屏幕像素大小为 0.28mm。

Units{'degrees'} {'imperial'} {'nautical'} {'metric'} {'us'}

比例线的单位。