Skip to main content

ScaleBar

The ScaleBar component displays a visual scale showing map distances in metric and/or imperial units.

Props

string
Position of the scale bar on the mapOptions:
  • 'left-top'
  • 'left-middle'
  • 'left-bottom'
  • 'right-top'
  • 'right-middle'
  • 'right-bottom'
  • 'top-left'
  • 'top-center'
  • 'top-right'
  • 'bottom-left'
  • 'bottom-center'
  • 'bottom-right' (default)
boolean
default:false
Disable the scale bar
boolean
default:true
Control visibility of the scale bar

Basic Usage

Custom Position

With Other Controls

Dynamic Behavior

The scale bar automatically updates:
  • When the map zoom level changes
  • When the map is panned to different latitudes (scale varies by latitude)
  • Shows appropriate units based on zoom level

Units Display

The scale bar shows:
  • Metric (meters/kilometers)
  • Imperial (feet/miles)
  • Both units simultaneously
The displayed unit automatically switches based on the appropriate scale:
  • At high zoom: meters/feet
  • At low zoom: kilometers/miles

Positioning Examples

Best for most layouts (default)

Conditional Visibility

Full Controls Layout

Use Cases

Distance Reference

Help users understand real-world distances on the map

Planning

Useful for route planning and measuring areas

Navigation

Essential for navigation applications

Context

Provides geographic context at different zoom levels

Accessibility

The scale bar provides visual reference for:
  • Screen magnification users
  • Print versions of the map
  • Screenshots and documentation

See Also

ZoomControl

Zoom controls

MapSettings

Map configuration

HereMap

Main map component