Scale bar

Shows the current map scale.

type: scalestandalonestable

What it does

The scale bar shows what a distance on the screen is worth on the ground.

Scale changes with latitude. The same pixel is a shorter ground distance near the poles than at the equator, so the bar is sized from the map's current bounds.

The number is rounded to something readable. The bar length changes to land on a round value such as "500 m."

A scale bar is not a ruler. For an actual measurement, with a total and an area, use the measure tool.

Using it

Read it. The bar shows a distance and the length on screen that distance occupies. The scale redraws as you zoom and pan.

In your own map

Add scale with a position, usually bottom-left.

Extending it

The control asks the adapter for the map's bounds. That gives the same path for all engines and for projections other than Web Mercator.

Config typescale
Element<webmapx-scale-control>
Placementstandalone
Sourcesrc/components/webmapx-scale-control.ts
Teststests/tool-registration.test.ts
Relatedmeasure, coordinates, navigation