Skip to content

scale_control

Stable

A scale bar for the current zoom level.

Generated from the component's definition in the library, so it always matches the version this demo runs.

Attribute Type Default Description
id required string — Unique identifier for the control
map_id required string — ID of the map to add the control to
position string "bottom-left" Control position: "top-left", "top-right", "bottom-left", "bottom-right". Defaults to "bottom-left". A new value moves the control to that corner
max_width integer 100 Maximum width of the scale control in pixels. Defaults to 100. A new value applies to the scale at once
unit string "metric" Unit of measurement: "imperial" (miles/feet), "metric" (kilometers/meters), or "nautical" (nautical miles). Defaults to "metric". A new value applies to the scale at once
global attributes global — Any other HTML attribute, passed on to the component's element.