๐งฉ LCircle โ
Draw a path in the shape of a circle around a center positioned at
latLng
coordinates.
It's an approximation and starts to diverge from a real circle closer to the poles (due to projection distortion).
๐งช Demo โ
vue
<script setup lang="ts">
import { LCircle, LMap, LTileLayer } from '@maxel01/vue-leaflet'
</script>
<template>
<LMap ref="map" :zoom="11" :center="[44.48865, 11.3317]">
<LTileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
layer-type="base"
name="OpenStreetMap"
/>
<LCircle :lat-lng="[44.48865, 11.3317]" :radius="5000" color="green" />
</LMap>
</template>
โ๏ธ Props โ
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
radius | Radius of the circle, in meters | number | true | - | true |
๐ 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 |
---|---|---|---|---|---|
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 |
interactive | If false , the layer will not emit pointer events and will act as a part of the underlying map. | 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 |
๐ก Emits โ
Event | Arguments | Description |
---|---|---|
update:visible | boolean | Triggers when the visible prop needs to be updated |
ready | T | Triggers when the component is ready |
๐ฏ Slots โ
Name | Description |
---|---|
default | Used to inject Leaflet child components like <LPopup> or <LTooltip> into the LCircleMarker . |
๐งญ Exposes โ
Name | Type | Description |
---|---|---|
ready | Ref<boolean> | Indicates whether the component and its underlying Leaflet object are fully initialized. |
leafletObject | Ref<Circle | undefined> | The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state). |