React + Vite + TypeScript map viewer built on OpenLayers. It loads WMTS capabilities, lets you toggle layers, and edit GeoJSON directly in the UI.
- WMTS capabilities loading with layer selection
- Optional
x-api-keyheader for WMTS requests - GeoJSON editor with draw tools
- OpenLayers map with zoom controls
- GeoJSON and shapefile (zip) import/export
- Automatic bbox calculation for FeatureCollections
- WKT input synced with the editor (paste WKT to load)
npm install
npm run devConfiguration is loaded in this order (later values override earlier ones):
config/default.jsonconfig/local.jsonpublic/config/default.json(runtime)public/config/local.json(runtime)
public/config/default.json and public/config/local.json are fetched on app boot, so you can change WMTS settings after deploy without rebuilding. Local overrides default.
config/default.json provides the baseline configuration. You can add overrides in config/local.json (ignored by version control).
Example public/config/local.json:
{
"wmtsCapabilitiesUrl": "https://example.com/wmts?SERVICE=WMTS&REQUEST=GetCapabilities",
"mapProjection": "EPSG:4326",
"wmtsApiKey": "your-api-key",
"defaultWmtsLayers": ["example-layer-id", "secondary-layer-id"]
}The app syncs GeoJSON to the URL using URL-safe base64 in the geo query param. The payload is minified JSON (no spaces/newlines) and includes an auto-calculated bbox for FeatureCollections. Pasting a URL with ?geo=... loads the GeoJSON into the editor and map.
The current map view is stored in the map query param as zoom,x,y using config.mapProjection coordinates. The URL is ordered as ?map=...&geo=... when both are present. The map param is only written after you drag or zoom the map. If map is not present, loading geo fits the view to the GeoJSON bbox.
npm run buildnpm run previewSome SVG icons are from SVG Repo
Licensed under the MIT License.