Skip to content

๐Ÿงฉ LWmsTileLayer โ€‹

Display WMS services as tile layers on the map.

๐Ÿงช Demo โ€‹

vue
<script setup lang="ts">
import { LMap, LWmsTileLayer } from '@maxel01/vue-leaflet'
</script>

<template>
    <LMap :zoom="2" :center="[47.41322, -1.219482]">
        <LWmsTileLayer
            url="https://ows.mundialis.de/services/service?"
            attribution="Mundialis"
            layer-type="base"
            name="mundialis.de"
            :max-zoom="10"
            version="1.3.0"
            format="image/png"
            :transparent="true"
            :layers="'TOPO-WMS,OSM-Overlay-WMS'"
        />
    </LMap>
</template>

โš™๏ธ Props โ€‹

Prop nameDescriptionTypeReactiveDefaultRequired
layersComma-separated list of WMS layers to showstringinitOnly-true
stylesComme-separated list of WMS stylesstringinitOnly-false
formatWMS image format (use image/png for layers with transparency)stringinitOnly-false
transparentIf true, the WMS service will return images with transparencybooleaninitOnly-false
versionVersion of the WMS service to usestringinitOnly-false
crsCoordinate Reference System to use for the WMS requests, defaults to the map CRS. Don't change this if you're not sure what it means.CRSinitOnly-false
uppercaseIf true, WMS request parameter keys will be uppercase.booleaninitOnly-false

๐Ÿ”— Inherited props โ€‹

from TileLayerProps
Prop nameDescriptionTypeReactiveDefaultRequired
urlA string of the form 'https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'. See more in the original Leaflet documentationstringtrue-true
detectRetinaIf true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.booleaninitOnly-false
subdomainsSubdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.string | ArrayinitOnly-false
tmsIf true, inverses Y axis numbering for tiles (turn this on for TMS services)booleaninitOnly-false
from GridLayerAbstractProps
Prop nameDescriptionTypeReactiveDefaultRequired
opacityOpacity of the tiles. Can be used in the createTile() function.numbertrue-false
zIndexThe explicit zIndex of the tile layernumbertrue-false
tileSizeWidth and height of tiles in the grid. Use a number if width and height are equal, or Point(width, height) otherwise.number | PointExpressioninitOnly-false
noWrapWhether the layer is wrapped around the antimeridian. If true, the GridLayer will only be displayed once at low zoom levels. Has no effect when the map CRS doesn't wrap around. Can be used in combination with bounds to prevent requesting tiles outside the CRS limits.booleaninitOnly-false
minZoomThe minimum zoom level down to which this layer will be displayed (inclusive)numberinitOnly-false
maxZoomThe maximum zoom level up to which this layer will be displayed (inclusive)numberinitOnly-false
classNameA custom class name to assign to the tile layer. Empty by default.stringinitOnly-false
from LayerProps
Prop nameDescriptionTypeReactiveDefaultRequired
visible-booleantrue-false
layerType-LayerTypetrue-false
name-stringtrue-false
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.stringtrue-false
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 default. Not effective if the renderer option is set (the renderer option will override the pane option).stringinitOnly-false
from ComponentProps
Prop nameDescriptionTypeReactiveDefaultRequired
optionsLeaflet options to pass to the component constructor.TinitOnly-false

๐Ÿ“ก Emits โ€‹

EventArgumentsDescription
update:visiblebooleanTriggers when the visible prop needs to be updated
readyTTriggers when the component is ready

๐Ÿงญ Exposes โ€‹

NameTypeDescription
leafletObjectRef<TileLayer.WMS | undefined>The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state).