Skip to content

🧩 LControlZoom

A basic zoom control with two buttons (zoom in and zoom out).

🧪 Demo

vue
<script setup lang="ts">
import { LControlZoom, LMap, LTileLayer } from '@maxel01/vue-leaflet'
</script>

<template>
    <LMap ref="map" :zoom="2" :center="[47.41322, -1.219482]">
        <LTileLayer
            url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
            layer-type="base"
            name="OpenStreetMap"
        />
        <LControlZoom position="bottomright" zoom-in-text="*" zoom-out-text="/" />
    </LMap>
</template>

⚙️ Props

Prop nameDescriptionTypeReactiveDefaultRequired
zoomInTextThe text set on the 'zoom in' buttonstringinitOnly-false
zoomInTitleThe title set on the 'zoom in' buttonstringinitOnly-false
zoomOutTextThe text set on the 'zoom out' buttonstringinitOnly-false
zoomOutTitleThe title set on the 'zoom out' buttonstringinitOnly-false

🔗 Inherited props

from ControlAbstractProps
Prop nameDescriptionTypeReactiveDefaultRequired
positionThe position of the control (one of the map corners). Possible values are topleft, topright, bottomleft or bottomright.ControlPositiontrue-false
from ComponentProps
Prop nameDescriptionTypeReactiveDefaultRequired
optionsLeaflet options to pass to the component constructor.TinitOnly-false

📡 Emits

EventArgumentsDescription
readyTTriggers when the component is ready

🧭 Exposes

NameTypeDescription
leafletObjectRef<Control.Zoom | undefined>The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state).