Examples
Great Circle Layer (deck.gl)
Great circle arcs showing the shortest path between points on Earth.
Installation
$ npx shadcn-vue@latest add https://mapcn-vue.geoql.in/r/map-deckgl-geoUsage
<script setup lang="ts">
import { VMap, VControlNavigation } from '@geoql/v-maplibre';
import { VLayerDeckglGreatCircle } from '@geoql/v-maplibre/deck.gl';
const mapOptions = {
style: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
center: [0, 30],
zoom: 1.5,
};
const flightData = [
{ from: [-122.4, 37.8], to: [139.7, 35.7], name: 'SF → Tokyo', color: [255, 140, 0] },
{ from: [-122.4, 37.8], to: [-0.12, 51.5], name: 'SF → London', color: [0, 200, 150] },
// ... more routes
];
</script>
<template>
<VMap :options="mapOptions" class="h-125 w-full">
<VControlNavigation position="top-right" />
<VLayerDeckglGreatCircle
id="great-circle-layer"
:data="flightData"
:get-source-position="(d) => d.from"
:get-target-position="(d) => d.to"
:get-source-color="(d) => d.color"
:get-target-color="(d) => [...d.color, 100]"
:get-stroke-width="3"
:pickable="true"
/>
</VMap>
</template> Components 3
<VMap />@geoql/v-maplibre<VControlNavigation />@geoql/v-maplibre<VLayerDeckglGreatCircle />@geoql/v-maplibre/deck.gl