v-maplibre provides Vue 3 components for all major deck.gl layer types. These layers render on a separate WebGL canvas (overlaid mode) for optimal performance and easier debugging.
Install the required deck.gl packages alongside v-maplibre:
pnpm add @geoql/v-maplibre @deck.gl/core @deck.gl/layers @deck.gl/mapbox
npm install @geoql/v-maplibre @deck.gl/core @deck.gl/layers @deck.gl/mapbox
For additional layer types, install the corresponding packages:
pnpm add @deck.gl/aggregation-layers # Heatmap, Hexagon, Grid, etc.
pnpm add @deck.gl/geo-layers # Trips, MVT, Tile, H3, etc.
pnpm add @deck.gl/mesh-layers # SimpleMesh, Scenegraph
<script setup lang="ts">
import { VMap, VLayerDeckglScatterplot } from '@geoql/v-maplibre';
const mapOptions = {
style: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
center: [-122.4, 37.8],
zoom: 11,
};
const data = [
{ coordinates: [-122.4, 37.8], size: 100 },
{ coordinates: [-122.5, 37.7], size: 200 },
];
</script>
<template>
<VMap :options="mapOptions" style="height: 500px">
<VLayerDeckglScatterplot
id="scatterplot"
:data="data"
:get-position="(d) => d.coordinates"
:get-radius="(d) => d.size"
:get-fill-color="[255, 140, 0]"
:radius-min-pixels="5"
:pickable="true"
@click="(info) => console.log('Clicked:', info.object)"
/>
</VMap>
</template>
| Component | Description | Example |
|---|---|---|
VLayerDeckglScatterplot | Circles/points at geographic positions | Demo |
VLayerDeckglArc | Arcs between origin-destination pairs | Demo |
VLayerDeckglLine | Flat lines between points | Demo |
VLayerDeckglPath | Polylines/routes with width | Demo |
VLayerDeckglPolygon | Filled/stroked polygons | Demo |
VLayerDeckglSolidPolygon | Extruded 3D polygons | Demo |
VLayerDeckglGeojson | GeoJSON features with styling | Demo |
VLayerDeckglIcon | Icons/markers at positions | Demo |
VLayerDeckglText | Text labels | Demo |
VLayerDeckglColumn | 3D columns/cylinders | Demo |
VLayerDeckglBitmap | Georeferenced images | Demo |
VLayerDeckglGridCell | Grid cells with elevation | Demo |
VLayerDeckglPointCloud | 3D point clouds | Demo |
| Component | Description | Example |
|---|---|---|
VLayerDeckglHeatmap | Density heatmap visualization | Demo |
VLayerDeckglHexagon | Hexagonal binning with elevation | Demo |
VLayerDeckglGrid | Square grid aggregation | Demo |
VLayerDeckglContour | Contour/isoline visualization | Demo |
VLayerDeckglScreenGrid | Screen-space grid (fixed pixel size) | Demo |
| Component | Description | Example |
|---|---|---|
VLayerDeckglTrips | Animated path visualization | Demo |
VLayerDeckglMVT | Mapbox Vector Tiles | Demo |
VLayerDeckglTile | Generic tile layer | Demo |
VLayerDeckglTile3D | 3D Tiles (Cesium format) | - |
VLayerDeckglTerrain | Terrain mesh from elevation data | Demo |
VLayerDeckglH3Hexagon | H3 hexagonal cells | Demo |
VLayerDeckglH3Cluster | H3 hexagon clusters | Demo |
VLayerDeckglGreatCircle | Great circle arcs | Demo |
VLayerDeckglS2 | S2 geometry cells | Demo |
VLayerDeckglGeohash | Geohash grid cells | Demo |
VLayerDeckglQuadkey | Quadkey tile cells | Demo |
VLayerDeckglWMS | WMS tile service | Demo |
| Component | Description | Example |
|---|---|---|
VLayerDeckglSimpleMesh | 3D mesh objects | Demo |
VLayerDeckglScenegraph | glTF/GLB 3D models | Demo |
| Component | Description | Example |
|---|---|---|
VLayerDeckglCOG | Cloud-Optimized GeoTIFF (GPU-accelerated) | Demo |
| Component | Description | Example |
|---|---|---|
VLayerDeckgl | Generic wrapper for any deck.gl layer | - |
All deck.gl layer components share these common props:
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | required | Unique layer identifier |
data | array | string | Promise | required | Data source |
visible | boolean | true | Layer visibility |
opacity | number | 1 | Layer opacity (0-1) |
pickable | boolean | true | Enable picking/interaction |
autoHighlight | boolean | false | Highlight on hover |
highlightColor | Color | - | Highlight color |
beforeId | string | - | MapLibre layer to insert before |
All layers emit these events when pickable is enabled:
| Event | Payload | Description |
|---|---|---|
@click | PickingInfo | Clicked on a feature |
@hover | PickingInfo | Hovering over a feature |
<VLayerDeckglScatterplot
:pickable="true"
@click="handleClick"
@hover="handleHover"
/>
Many props accept accessor functions for data-driven styling:
<VLayerDeckglScatterplot
:data="data"
:get-position="(d) => d.coordinates"
:get-radius="(d) => d.population / 1000"
:get-fill-color="(d) => d.risk > 0.5 ? [255, 0, 0] : [0, 255, 0]"
/>
Import types from deck.gl packages:
import type { Color, PickingInfo, Position } from '@deck.gl/core';