Skip to content

ol-scaleline-control

A Scale Line control for OpenLayers.

Usage

vue
<template>
  <ol-map style="height: 400px" :controls="[]">
    <ol-view :center="center" :zoom="zoom" :projection="projection" />

    <ol-tile-layer>
      <ol-source-osm />
    </ol-tile-layer>
    <ol-scaleline-control />
  </ol-map>
</template>

<script setup>
import { ref } from "vue";
const center = ref([40, 40]);
const projection = ref("EPSG:4326");
const zoom = ref(8);
</script>

Properties

className

  • Type: String
  • Default: ol-scale-line

minWidth

  • Type: Number
  • Default: 64

render

  • Type: Function

target

  • Type: HTMLElement

units

  • Type: String
  • Default: metric

bar

  • Type: Boolean
  • Default: false

steps

  • Type: Number
  • Default: 4

text

  • Type: Boolean
  • Default: false

dpi

  • Type: Number
  • Default: undefined