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).