Softwarity

@softwarity/geojson-editor

npm version bundle size license codecov
menu_book Documentation GitHub language Softwarity
A lightweight Web Component for editing GeoJSON — with built-in validation, contextual type highlighting, auto-collapse coordinates, and feature visibility toggle (eye icon to hide/show features from events). No Monaco (2.5 MB), no CodeMirror (150 KB), just what you need for GeoJSON.

Theme

Editor Options

Shown when editor is empty
Note: Edit features directly (comma-separated). The component wraps them in a FeatureCollection and emits the complete structure on change events.
GeoJSON Editor
MapLibre Preview

Features API

Events:

change

FeatureCollection (all visible features)

Waiting for change events...

current-features

FeatureCollection at cursor/selection

null

Error Events:

When JSON is invalid, the component emits error events with: timestamp, error (error message), content (editor content for debugging)

No errors

HTML Code:

Copy this code to use the component in your own page (updates automatically with your settings)