Minimal path: install packages → style function → config JSON → mount a map. No municipal stack required.
Mapsight in this repository is WIP — the steps below reflect the npm library contract; production CMS deployments add host builds, data pipelines, and ops layers (see Integration overview).
- Node 24+, pnpm (monorepo) or npm/yarn in your app
- A DOM container (
<div id="map">)
pnpm add @mapsight/ui @mapsight/core @mapsight/lib-ol @mapsight/traffic-styleAdd peer dependencies (react, react-dom, ol, …) as required by your bundler — see @mapsight/ui on npm.
Mapsight needs a compiled vector styleFunction (OpenLayers styling). Fastest path: build from
@mapsight/traffic-style or @mapsight/vector-style-compiler —
see traffic-style README.
const mapsightConfig = {
map: {
layers: {
osm: {
type: "TileLayer",
options: {
source: {
type: "OsmSource",
options: {
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
},
},
},
},
},
},
featureSources: {
pois: {type: "xhr-json", url: "/data/pois.geojson"},
},
list: {
featureSource: "pois",
visible: true,
},
};Validated in development via Zod — see Config reference.
Basemaps: raw OSM URLs are fine for local dev. Production hosts usually use a self-hosted or proxied basemap — see Ecosystem § basemaps.
import {create} from "@mapsight/ui";
import styleFunction from "./generated/styleFunction";
const el = document.getElementById("map");
if (el) {
create(el, styleFunction, mapsightConfig);
}CMS hosts use Vite lib mode, stable asset URLs, and browserEmbed from @mapsight/ui/embed/browser:
import browserEmbed from "@mapsight/ui/embed/browser";
import {simpleMap} from "./presets/simpleMap";
browserEmbed(containerElement, simpleMap({/* inline options */}));Full build + snippet pattern: CMS_PHP, the reference starter
starters/mapsight-host-starter, and
@mapsight/vite-host-embed.
For count-aggregator CMS pages (full app shell, not lib-mode map embeds), see
count-aggregator-ui.
| Goal | Read |
|---|---|
| Full config anatomy | CONFIG_REFERENCE |
| SPA integration | REACT_SPA |
| Next.js | NEXTJS |
| Municipal data pipeline | PULP |
| Architecture depth | Redux architecture |