---
name: geoman-maplibre
description: Integrate MapLibre-Geoman or the Mapbox-Geoman adapter for drawing, editing and GeoJSON import/export. Use for MapLibre GL JS or Mapbox GL JS applications, including React and SSR integrations.
---

# Build with MapLibre/Mapbox-Geoman

Identify the renderer, installed versions and Free/Pro edition before editing. MapLibre and Mapbox have separate Geoman packages; use the adapter for the existing renderer. Their Geoman API uses a `Geoman` instance and `gm:*` events. Leaflet's `map.pm`, `layer.pm` and `pm:*` events do not apply.

## Find authoritative examples

Search official docs with `search_geoman_docs`, setting `library` to `maplibre` for either adapter, then read the result with `read_geoman_doc`. Follow `nextOffset` when a page continues. If the tools are unavailable, read the [documentation index](https://geoman.io/docs/maplibre/llms.txt) and [full Markdown documentation](https://geoman.io/docs/maplibre/llms-full.txt).

- [Basic usage and installation](https://geoman.io/docs/maplibre/basics): renderer-specific imports, CSS, workers and initialization.
- [Configuration](https://geoman.io/docs/maplibre/configuring-geoman): modes and controls.
- [Importing data](https://geoman.io/docs/maplibre/importing-data) and [exporting data](https://geoman.io/docs/maplibre/exporting-data): feature IDs and GeoJSON persistence.
- [Events](https://geoman.io/docs/maplibre/events): readiness and geometry changes.

## Integrate

Create the map in a mounted container with an explicit height. Initialize browser-only libraries on the client when using SSR. Load the renderer and Geoman styles, and follow the worker configuration required by the installed renderer and bundler.

Register readiness listeners immediately after constructing Geoman; wait for `gm:loaded` before invoking drawing or feature operations that require initialization. Use the documented mode methods and feature-store import/export APIs for the installed version. Do not invent Mapbox GL Draw methods on Geoman.

Preserve feature IDs and properties when importing or exporting. Synchronize application state after edits and deletions as well as creation. On unmount, unregister listeners and destroy the Geoman/map instances as their documented lifecycle requires. Verify React StrictMode/remount behavior when applicable.

Check an end-to-end drawing → editing → export → import round trip in the application. Features marked ⭐ require Pro; confirm the installed edition before recommending them. Keep private-registry credentials out of generated source and tool requests. Review current license scope at https://geoman.io/pricing.
