Skip to content

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="&amp;copy; <a href=&quot;https://www.openstreetmap.org/&quot;>OpenStreetMap</a> contributors"
    layer-type="base"
    name="OpenStreetMap"
  />
  <LMarker :lat-lng="[50, 50]" draggable />
</LMap>

Props

Prop nameDescriptionTypeRequiredDefault
draggableWhether the marker is draggable with mouse/touch or notBoolean-false
iconIcon 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()
zIndexOffsetBy 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
latLngThe position of the markerObject|Array as L.LatLngExpressiontruenull

Inherited props

from layer.ts
Prop nameDescriptionTypeRequiredDefault
paneBy 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 defaultString-'overlayPane'
attributionString 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
nameString--
layerTypeString in ["base", "overlay"]--
visibleBoolean-true
from component.ts
Prop nameDescriptionTypeRequiredDefault
optionsLeaflet options to pass to the component constructorObject-{}

Events

Event nameTypeDescription
update:visiblebooleanTriggers when the visible prop needs to be updated
readyobjectTriggers when the component is ready
update:latLngundefined
update:lat-lngundefined

Slots

NameDescriptionBindings
default