Skip to content

LMap

Base component, contains and wraps all the other components.

Demo

vue
<LMap style="height: 350px" :zoom="6" :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"
  />
</LMap>

Props

Prop nameDescriptionTypeRequiredDefault
centerThe center of the map, supports .sync modifierObject|Array as L.PointExpression-[0, 0]
boundsThe bounds of the map, supports .sync modifierArray|Object-null
maxBoundsThe max bounds of the mapArray|Object-null
zoomThe zoom of the map, supports .sync modifierNumber-0
minZoomThe minZoom of the mapnumber-null
maxZoomThe maxZoom of the mapNumber-null
paddingBottomRightThe paddingBottomRight of the mapArray|Object as L.PointExpression-null
paddingTopLeftThe paddingTopLeft of the mapObject as L.PointExpression-null
paddingThe padding of the mapObject as L.PointExpression-null
worldCopyJumpWith this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.Boolean-false
crsThe crs option for the mapObject (See CRS)-CRS.EPSG3857
maxBoundsViscosityIf maxBounds is set, this option will control how solid the bounds are when dragging the map around. The default value of 0.0 allows the user to drag outside the bounds at normal speed, higher values will slow down map dragging outside bounds, and 1.0 makes the bounds fully solid, preventing the user from dragging outside the bounds.Number-0.0
inertiaIf enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices. Enabled by default.Boolean-true
inertiaDecelerationThe rate with which the inertial movement slows down, in pixels/second².Number-3000
inertiaMaxSpeedMax speed of the inertial movement, in pixels/second.Number-Infinity
easeLinearityNumber-0.2
zoomAnimationWhether the map zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.Boolean-true
zoomAnimationThresholdWon't animate zoom if the zoom difference exceeds this value.Number-4
fadeAnimationWhether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.Boolean-true
markerZoomAnimationWhether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.Boolean-true
noBlockingAnimationsBoolean-false
useGlobalLeafletBoolean-true

Inherited props

from component.ts
Prop nameDescriptionTypeRequiredDefault
optionsLeaflet options to pass to the component constructorObject-{}

Events

Event nameTypeDescription
readyobjectTriggers when the component is ready
update:zoomnumber,stringTriggers when zoom is updated
update:centerobject,arrayTriggers when center is updated
update:boundsobjectTriggers when bounds are updated

Slots

NameDescriptionBindings
default