Introduction β
The Geospatial SDK is a modular toolkit for building web mapping applications faster and with less boilerplate. It provides a set of battle-tested utilities and stable interfaces that can be reused across many different projects.
What Problem Does It Solve? β
Building web maps typically involves:
- Tight coupling to specific mapping libraries (OpenLayers, MapLibre GL, Leaflet, etc.)
- Imperative code that's difficult to serialize or share across users
- Complex state management when maps need to update dynamically
- Repetitive boilerplate for common geospatial tasks like geocoding or legends
The Geospatial SDK addresses these challenges by providing a declarative Map Context model that separates map configuration from rendering, along with utilities for common geospatial operations.
Key Features β
Declarative Map Configuration β
Define maps using plain JavaScript objects called Map Contexts. This makes maps:
- Serializable: Easy to store in an application state or in a database
- Shareable: Reuse and share map configurations between users or applications
- Framework-agnostic: Use the same configuration with different rendering libraries
const mapContext = {
layers: [
{
type: "xyz",
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
},
],
view: {
zoom: 5,
center: [6, 48.5],
},
};Smart Map Updates β
The SDK provides a Map Context diff system that compute the minimal changes needed to update an existing map. Instead of recreating everything, only modified layers and view properties are updatedβimproving performance and preserving map state.
Modular Architecture β
Only include the packages needed for your project:
@geospatial-sdk/core: Map Context types and utilities (required)@geospatial-sdk/openlayers: OpenLayers integration@geospatial-sdk/maplibre: MapLibre GL integration@geospatial-sdk/geocoding: Geocoding providers@geospatial-sdk/legend: Legend generation@geospatial-sdk/elements: Web Components for maps
See the API reference for more information.
Support for Multiple Layer Types β
Support for common geospatial data sources out of the box:
- XYZ tiles (raster and vector)
- OGC standards (WMS, WMTS, WFS, OGC API)
- GeoJSON (inline or from URLs)
- MapLibre Style Spec
- etc.
Quick Start β
Install the core package and a rendering library:
npm install @geospatial-sdk/core @geospatial-sdk/openlayersCreate a map from a Map Context:
import { createMapFromContext } from "@geospatial-sdk/openlayers";
const mapContext = {
layers: [
{
type: "xyz",
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
},
],
view: {
zoom: 5,
center: [6, 48.5],
},
};
createMapFromContext(mapContext, document.getElementById("map"));Next Steps β
- Explore the API documentation for detailed package references
- Check out live examples to see the SDK in action