๐งฉ LControlAttribution โ
The attribution control allows you to display attribution data in a small text bos on a map.
๐งช Demo โ
vue
<script setup lang="ts">
import { LControlAttribution, LMap, LTileLayer } from '@maxel01/vue-leaflet'
import { ref } from 'vue'
const customAttributionPrefix = ref<string>('<strong>Custom bottom left attribution</strong>')
</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"
/>
<LControlAttribution position="bottomleft" :prefix="customAttributionPrefix" />
</LMap>
</template>
โ๏ธ Props โ
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
prefix | The HTML text shown before the attributions. Pass false to disable. | string | false | true | - | false |
๐ Inherited props โ
from ControlAbstractProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
position | The position of the control (one of the map corners). Possible values are topleft , topright , bottomleft or bottomright . | ControlPosition | true | - | false |
from ComponentProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
options | Leaflet options to pass to the component constructor. | T | initOnly | - | false |
๐ก Emits โ
Event | Arguments | Description |
---|---|---|
ready | T | Triggers when the component is ready |
๐งญ Exposes โ
Name | Type | Description |
---|---|---|
leafletObject | Ref<Control.Attribution | undefined> | The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state). |