---
title: "<ScriptMapLibreScaleControl> · Nuxt Scripts"
description: "Adds MapLibre's scale bar to the nearest parent map. MapLibre places it in the bottom-left corner by default."
canonical_url: "https://scripts.nuxt.com/scripts/maplibre/api/scale-control"
meta:
  "og:description": "Adds MapLibre's scale bar to the nearest parent map. MapLibre places it in the bottom-left corner by default."
  "og:image": "https://scripts.nuxt.com/_og/s/o_c235debee7cfd4df.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "<ScriptMapLibreScaleControl> · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_c235debee7cfd4df.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Api**

# **\<ScriptMapLibreScaleControl>**

[Copy for LLMs](https://scripts.nuxt.com/scripts/maplibre/api/scale-control.md)

Adds MapLibre's scale bar to the nearest parent map. MapLibre places it in the bottom-left corner by default.

```vue
<template>
  <ScriptMapLibreMap map-style="https://tiles.openfreemap.org/styles/liberty" :center="[147.33, -42.88]">
    <ScriptMapLibreScaleControl position="bottom-left" :options="{ unit: 'metric', maxWidth: 120 }" />
  </ScriptMapLibreMap>
</template>
```

`**new maplibregl.ScaleControl()**` reads `**options**` and `**position**` once, when it creates the control. `**options.unit**` also updates reactively through `**setUnit()**`. To apply any other change, change the component `**key**`.

`**position**``MapLibre.ControlPosition`

`**options**``MapLibre.ScaleControlOptions`

Options passed to \`new maplibregl.ScaleControl()\`. \`unit\` also updates reactively through \`setUnit()\`.

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/maplibre/2.api/7.scale-control.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/maplibre/api/scale-control.md)

[**useScriptMapLibre** Use useScriptMapLibre() when you need direct access to the MapLibre namespace or are building your own map component.](https://scripts.nuxt.com/scripts/maplibre/api/use-script-maplibre) [**\<ScriptMapLibreGeolocateControl>** Adds MapLibre's geolocate button to the nearest parent map. The button asks the browser for the user's location and moves the camera there.](https://scripts.nuxt.com/scripts/maplibre/api/geolocate-control)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/maplibre/api/scale-control#webpage","@type":"WebPage","description":"Adds MapLibre's scale bar to the nearest parent map. MapLibre places it in the bottom-left corner by default.","name":"<ScriptMapLibreScaleControl>","url":"https://scripts.nuxt.com/scripts/maplibre/api/scale-control","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/maplibre/api/scale-control#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/maplibre/api/scale-control"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/maplibre/api/scale-control#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"Maplibre","item":"https://scripts.nuxt.com/scripts/maplibre","position":3},{"@type":"ListItem","name":"API","item":"https://scripts.nuxt.com/scripts/maplibre/api","position":4},{"@type":"ListItem","name":"<ScriptMapLibreScaleControl>","item":"https://scripts.nuxt.com/scripts/maplibre/api/scale-control","position":5}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
