LMarker
Used to display clickable/draggable markers on the map.
Demo
vue
<LMap style="height: 350px" :zoom="2" :center="[47.21322, -1.559482]">
<LTileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution="&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors"
layer-type="base"
name="OpenStreetMap"
/>
<LMarker :lat-lng="[50, 50]" draggable />
</LMap>Props
| Prop name | Description | Type | Required | Default |
|---|---|---|---|---|
| draggable | Whether the marker is draggable with mouse/touch or not | Boolean | - | false |
| icon | Icon instance to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. | Object as L.Icon | - | L.Icon.Default() |
| zIndexOffset | By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively). | Number | - | 0 |
| latLng | The position of the marker | Object|Array as L.LatLngExpression | true | null |
Inherited props
from layer.ts
| Prop name | Description | Type | Required | Default |
|---|---|---|---|---|
| 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 | String | - | 'overlayPane' |
| 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 | - | null |
| name | String | - | - | |
| layerType | String in ["base", "overlay"] | - | - | |
| visible | Boolean | - | true |
from component.ts
| Prop name | Description | Type | Required | Default |
|---|---|---|---|---|
| options | Leaflet options to pass to the component constructor | Object | - | {} |
Events
| Event name | Type | Description |
|---|---|---|
| update:visible | boolean | Triggers when the visible prop needs to be updated |
| ready | object | Triggers when the component is ready |
| update:latLng | undefined | |
| update:lat-lng | undefined |
Slots
| Name | Description | Bindings |
|---|---|---|
| default |