Shared Vue 3 + OpenLayers geo components for AERIUS frontends. The stack is Vue 3, Vite, TypeScript, OpenLayers 10, proj4, and Pinia.
The library is built with Vite and ships as ESM. ol, vue, proj4, and pinia are
peer dependencies: the library does not bundle them, it uses the app's own copies.
Status: starting point. This repo sets up the build, tooling, and CI. The real map code comes in a follow-up. The
MapViewcomponent andRDhelper here are a small working example.
1. Point npm at Nexus for the @aerius scope. Add this line to the app's .npmrc:
@aerius:registry=https://nexus.aerius.nl/repository/npm/
(If reads need a login, run
npm login --scope=@aerius --registry=https://nexus.aerius.nl/repository/npm/ once.)
2. Install it, plus the peer dependencies if the app doesn't already have them:
npm install @aerius/vue-geo-components
npm install ol vue proj4 pinia3. Use it:
<script setup lang="ts">
import { MapView } from "@aerius/vue-geo-components";
import "@aerius/vue-geo-components/style.css";
import "ol/ol.css";
</script>
<template>
<MapView :zoom="7" style="height: 480px" />
</template>MapView uses the Dutch RD map projection (EPSG:28992) by default. Child components can
get the map with useMap().
Say an app uses this library and you want to always work against the latest version. There are two cases:
You are editing the library too. Use yalc: your local library changes show up in the app the moment you save - live, with nothing to publish. This is the fastest loop. See docs/local-development.md.
You just want the newest published build (you're not editing the library). Depend on
the dev tag in the app's package.json:
"@aerius/vue-geo-components": "dev"Every push to this library's main publishes a new dev snapshot. Pull the newest one
into the app with:
npm update @aerius/vue-geo-componentsEach snapshot has a unique version, so this always works cleanly. The app stays on whatever
is locked in its package-lock.json until you run npm update, so npm ci stays
reproducible. See docs/versioning.md.
For a stable build (e.g. on an app's release branch), depend on a real release number
instead of the dev tag:
npm install @aerius/vue-geo-components@0.2.0Real releases are published to the latest tag from a GitHub Release - see
docs/versioning.md.
Use Node 24 (see .nvmrc).
npm install
npm run dev # rebuild on every save
npm run lint
npm run type-check
npm test
npm run build # type-check + build dist/- Work on it against a consuming app: docs/local-development.md
- Releasing and versioning: docs/versioning.md
Everything comes from src/index.ts:
| Export | What it is |
|---|---|
MapView |
The OpenLayers map as a Vue component. Shares the map with child components. |
useMap / provideMap / mapInjectionKey |
Get or share the map instance. |
RD / registerRdProjection / isRdRegistered |
Dutch RD map projection (EPSG:28992). |
useMapViewStore |
Shared map state (center, zoom). |
AGPL-3.0-only. See LICENSE.