Examples
AC Transit Live (deck.gl)
Real-time bus tracking for AC Transit (Oakland/East Bay) using deck.gl layers. Click a bus to see its trail, or zoom in to see stops.
Installation
$ npx shadcn-vue@latest add https://mapcn-vue.geoql.in/r/map-deckgl-coreUsage
<script setup lang="ts">
import { VMap } from '@geoql/v-maplibre';
import { VLayerDeckglPath, VLayerDeckglIcon } from '@geoql/v-maplibre/deck.gl';
// Fetch real-time AC Transit data
const { buses, trails } = useActransitData();
// Accessor functions for deck.gl layers
const getBusPosition = (d) => d.coordinates;
const getBusAngle = (d) => d.bearing; // Rotate icon based on heading
const getTrailPath = (d) => d.path;
</script>
<template>
<VMap :options="mapOptions" class="h-full w-full">
<!-- Bus history trails -->
<VLayerDeckglPath
id="bus-trails"
:data="trails"
:get-path="getTrailPath"
:get-color="getTrailColor"
/>
<!-- Bus icons with bearing rotation -->
<VLayerDeckglIcon
id="buses"
:data="buses"
:get-position="getBusPosition"
:get-angle="getBusAngle"
:icon-atlas="busIconAtlas"
:billboard="false"
:pickable="true"
@click="handleBusClick"
/>
</VMap>
</template> Components 3
<VMap />@geoql/v-maplibre<VLayerDeckglPath />@geoql/v-maplibre/deck.gl<VLayerDeckglIcon />@geoql/v-maplibre/deck.gl