๐งฉ LDonut โ
A Leaflet plugin for drawing donuts.
๐งช Demo โ
vue
<script setup lang="ts">
import { LMap, LTileLayer } from '@maxel01/vue-leaflet'
import { LDonut } from '@maxel01/vue-leaflet-plugins'
</script>
<template>
<LMap :zoom="12" :center="[47.41322, -1.219482]">
<LTileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
layer-type="base"
name="OpenStreetMap"
/>
<LDonut :lat-lng="[47.41322, -1.219482]" :radius="2000" :inner-radius="500" />
</LMap>
</template>
โ๏ธ Props โ
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
radius | Outer radius. The outer radius must be greater than the inner radius. | number | true | - | true |
innerRadius | Inner radius. It can be a meter value or a percent (0-1) value of the outer radius. | number | true | - | true |
innerRadiusAsPercent | Defines if the inner radius is a percent value of the outer radius. | boolean | ? | - | false |
๐ Inherited props โ
from CircleMarkerProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
latLng | Position of the circle marker | LatLngExpression | true | - | true |
from PathProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
stroke | Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles. | boolean | true | - | false |
color | Stroke color | string | true | - | false |
weight | Stroke width in pixels | number | true | - | false |
opacity | Stroke opacity | number | true | - | false |
lineCap | A string that defines shape to be used at the end of the stroke. | LineCapShape | true | - | false |
lineJoin | A string that defines shape to be used at the corners of the stroke. | LineJoinShape | true | - | false |
dashArray | A string that defines the stroke dash pattern. | string | true | - | false |
dashOffset | A string that defines the distance into the dash pattern to start the dash. | string | true | - | false |
fill | Whether to fill the path with color. Set it to false to disable filling on polygons or circles. | boolean | true | - | false |
fillColor | Fill color | string | true | - | false |
fillOpacity | Fill opacity | number | true | - | false |
fillRule | A string that defines how the inside of a shape is determined. | FillRule | true | - | false |
className | Custom class name set on an element. Only for SVG renderer. | string | true | - | false |
from InteractiveLayerProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
interactive | If false , the layer will not emit pointer events and will act as a part of the underlying map. | boolean | initOnly | - | false |
bubblingMouseEvents | When true , a pointer event on this path will trigger the same event on the map (unless DomEvent.stopPropagation is used). | boolean | initOnly | - | false |
from LayerProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
pane | By default, the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. Not effective if the renderer option is set (the renderer option will override the pane option). | string | initOnly | - | false |
attribution | String to be shown in the attribution control, e.g. "ยฉ OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. | string | true | - | false |
name | - | string | true | - | false |
layerType | - | LayerType | true | - | false |
visible | - | boolean | true | - | false |
from ComponentProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
options | Leaflet options to pass to the component constructor. | T | initOnly | - | false |
๐ฏ Slots โ
Name | Description |
---|---|
default | Used to inject Leaflet child components like <LPopup> or <LTooltip> into the LDonut . |
๐งญ Exposes โ
Name | Type | Description |
---|---|---|
ready | Ref<boolean> | Indicates whether the component and its underlying Leaflet object are fully initialized. |
leafletObject | Ref<Donut | undefined> | The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state). |