React components for building map applications using OpenLayers and MapLibre GL JS. Current version 3.0.1 with peer dependencies on maplibre-gl ^5, mobility-toolbox-js ^3.6, ol ^10, react ^19, and react-dom ^19. Actively maintained by geops. Provides real-time geographic visualization widgets (layers, controls, popups) with tight integration to both OpenLayers and MapLibre. Supports ES6 modules and SASS theming. Differentiates by offering a unified React component set over two major map libraries, built on top of mobility-toolbox-js.
npm install react-spatialNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal React app displaying an OpenLayers map using OLMap component and LayerService.
Upgrade to ol@^10 and react@^18 or ^19.
Import from the package root: import { Component } from 'react-spatial'Create a new LayerService instance and pass via layerService prop.
Add import 'react-spatial/themes/default/index.scss' in your entry file.
Install mobilitiy-toolbox-js@^3.6.
Install maplibre-gl@^5.
Ensure your bundler supports SCSS (e.g., sass-loader) and correct import path.
Instantiate LayerService and pass as prop: <OLMap layerService={new LayerService()} />Run npm install mobility-toolbox-js@^3.6
Upgrade to v3 or check correct component name.
Ensure LayerService is initialized before map mount, e.g., in component state.