Skip to content

ol-mouseposition-control

A Mouse Position control for OpenLayers.

Usage

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

    <ol-tile-layer>
      <ol-source-osm />
    </ol-tile-layer>
    <ol-mouseposition-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-mouse-position

coordinateFormat

  • Type: String

projection

  • Type: String

render

  • Type: Function

target

  • Type: HTMLElement