Examples
Icon Layer (deck.gl)
Render icons and sprites at geographic locations for points of interest.
Installation
$ npx shadcn-vue@latest add https://mapcn-vue.geoql.in/r/map-deckgl-coreUsage
<script setup lang="ts">
import { VMap, VControlNavigation } from '@geoql/v-maplibre';
import { VLayerDeckglIcon } from '@geoql/v-maplibre/deck.gl';
const mapOptions = {
style: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
center: [-122.4, 37.78],
zoom: 12,
};
const ICON_MAPPING = {
marker: { x: 0, y: 0, width: 128, height: 128, mask: true },
};
const iconData = [
{ position: [-122.42, 37.78], name: 'Location A', color: [255, 140, 0] },
{ position: [-122.38, 37.79], name: 'Location B', color: [0, 200, 150] },
// ... more points
];
</script>
<template>
<VMap :options="mapOptions" class="h-125 w-full">
<VControlNavigation position="top-right" />
<VLayerDeckglIcon
id="icon-layer"
:data="iconData"
:get-position="(d) => d.position"
:get-icon="() => 'marker'"
:get-color="(d) => d.color"
:get-size="40"
:icon-atlas="'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/icon-atlas.png'"
:icon-mapping="ICON_MAPPING"
:pickable="true"
/>
</VMap>
</template> Components 3
<VMap />@geoql/v-maplibre<VControlNavigation />@geoql/v-maplibre<VLayerDeckglIcon />@geoql/v-maplibre/deck.gl