Skip to content

ol-zoomtoextent-control

A Zoom to extent control for OpenLayers.

Usage

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

    <ol-tile-layer>
      <ol-source-osm />
    </ol-tile-layer>
    <ol-zoomtoextent-control tipLabel="Fit to Turkey" />
  </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-zoom-extent

target

  • Type: HTMLElement

label

  • Type: String
  • Default: E

tipLabel

  • Type: String
  • Default: Fit to extent

extent

  • Type: Array