๐งฉ LVideoOverlay โ
Used to load and display a video over specific bounds of the map.
๐งช Demo โ
vue
<script setup lang="ts">
import { LMap, LTileLayer, LVideoOverlay } from '@maxel01/vue-leaflet'
/**
* TODO Video doesn't seem to work in vitepress but works in playground.
*/
const videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm'
const videoBounds = [
[32, -130],
[13, -100]
]
</script>
<template>
<LMap :zoom="5" :center="[22.5, -115]" :minZoom="-5">
<LTileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
layer-type="base"
name="OpenStreetMap"
/>
<LVideoOverlay :video="videoUrl" :bounds="videoBounds"/>
</LMap>
</template>
โ๏ธ Props โ
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
video | Url of the video, urls of the videos or a video Element | string | Array | HTMLVideoElement | initOnly | - | true |
๐ Inherited props โ
from ImageOverlayAbstractProps
Prop name | Description | Type | Reactive | Default | Required |
---|---|---|---|---|---|
bounds | The geographical bounds | LatLngBoundsExpression | true | - | true |
className | A custom class name to assign to the image. Empty by default. | string | initOnly | - | false |
zIndex | The explicit zIndex of the overlay layer. | number | true | - | false |
errorOverlayUrl | URL to the overlay image to show in place of the overlay that failed to load. | string | initOnly | - | false |
crossOrigin | Whether the crossOrigin attribute will be added to the image. If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data. Refer to CORS Settings for valid String values. | boolean | initOnly | - | false |
interactive | If true , the image overlay will emit mouse events when clicked or hovered | boolean | initOnly | - | false |
alt | Text for the alt attribute of the image (useful for accessibility). | string | initOnly | - | false |
opacity | The opacity of the image overlay. | number | true | - | 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<VideoOverlay | undefined> | The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state). |