spatialbay-sdk
v0.5.0
Published
SpatialBay SDK — framework-light map engine (core, map, ui, processing) for MapLibre-based GIS apps.
Maintainers
Readme
spatialbay-sdk
A framework-light toolkit for MapLibre-based GIS apps: vector/raster basemap
theming, a marker icon registry, GPX/KML track parsing, workspace panel
layout presets, static poster export, in-browser SQL over GeoJSON (DuckDB
WASM), and a small set of Vue components (FloatingPanel, DockPanel,
ModalDialog, usePanelsStore) for panel-chrome UIs.
Most modules are pure JS with no Vue/Pinia dependency — usable in any
MapLibre app, not just SpatialBay. The SpatialBay frontend (../../src) is
the reference consumer: 40+ files there import from this package today.
Install (workspace-local)
This package is not yet published to a registry. Inside this monorepo it's
consumed via the spatialbay-sdk alias already wired into the app's
bundler config — see ../../vite.config.js.
import { generateMapStyle, MAP_THEMES, MARKER_ICONS, parseGPX, applyLayoutPreset, drawPosterOverlay } from 'spatialbay-sdk'Modules
| Area | Exports |
| --- | --- |
| Vector themes | MAP_THEMES, generateMapStyle, getMapTheme, blendHex |
| Raster basemaps | BASEMAP_THEMES, getTheme, applyBasemapTheme |
| Marker icons | MARKER_ICONS, getMarkerIcon |
| Track import | parseGPX, parseKML, parseTrack |
| Layout presets | LAYOUT_PRESETS, getLayoutPreset, applyLayoutPreset |
| Poster export | FONT_OPTIONS, ensureFont, POSTER_SIZES, drawPosterOverlay, formatCoordinates |
| Map controller | MapController, syncLayers, identifyAt, getUniqueValues, buildCategoryColors |
| Map controls | addNavigationControl, addCompassControl, addScaleControl, setGlobeEnabled, setTerrainEnabled, … |
| Effects | AtmosphereEffect, addWeatherRadar, updateSunOverlay |
| Directions | fetchRoute, showRoute, clearRoute, RouteAnimator |
| Street view | getMapillaryToken, addMapillaryCoverage, openMapillaryViewer |
| Data | runSql, registerGeoJsonTable (DuckDB WASM), getPyodide, runPython |
| UI (Vue) | usePanelsStore, FloatingPanel, DockPanel, ModalDialog |
| Project schema | createProject, serializeProject, deserializeProject, migrateProject |
| Docs content | docs.js — CONCEPTS, METHODS, SOURCES (drives the in-app /sdk/docs route) |
See CHANGELOG.md for what shipped in each version, and examples/ for
runnable configs demonstrating the newer additions (vector themes, marker
icons, GPX import, layout presets).
Testing
cd packages/spatialbay-sdk
npx vitest runTests are scoped to pure-logic modules (no .vue component tests yet):
themes.js, themeStyle.js, markerIcons.js, trackParsers.js,
layoutPresets.js.
Publishing
Not yet published to a registry — see ../../.npmrc (currently a template;
needs a real registry URL + auth token before this can publish).
