ScaleBar

The ScaleBar is a small line which represents the current map scale graphically.

../../../_images/scalebar1.png

Configuration

../../../_images/scalebar_configuration1.png
  • Title: Title of the element. The title will be listed in “Layouts”.

  • Max width: The maximum width of the scale bar (Default: 200px).

  • Units: Scale bar units ‘kilometer’ or ‘miles’ (Default: kilometer).

  • Position: Scale bar alignment (Default: Bottom right).

YAML-Definition:

tooltip: 'Scale Bar'             # text to use as tooltip
target: ~                        # ID of the Map element to query
anchor: 'inline'/'left-top'/     # scale bar alignment, default is 'right-bottom'
  'left-bottom'/'right-top'/     # use inline, e.g. in sidebar
  'right-bottom'
position: ['10px', '10px']       # scale bar position, default: x=20px, y=20px
maxWidth: 200                    # the maximum width of the scale bar, default 200px
units: ['km']                    # scale bar units 'kilometer' and/or 'miles' (ml), default ['km']