---
name: geoman-leaflet
description: Integrate Leaflet-Geoman drawing, editing, snapping and GeoJSON workflows into a Leaflet application. Use for the Leaflet renderer; MapLibre and Mapbox use a separate Geoman API.
---

# Build with Leaflet-Geoman

Read the application's dependencies first and preserve its renderer and Free/Pro edition. Leaflet-Geoman uses `map.pm` and `layer.pm`, with `pm:*` events. Do not copy MapLibre's `Geoman` class, `gm:*` events or feature-store methods into a Leaflet app.

## Find authoritative examples

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

- [Free installation](https://geoman.io/docs/leaflet/getting-started/free-version): package imports, CSS and initialization.
- [Pro installation](https://geoman.io/docs/leaflet/getting-started/pro-version): existing license and private-registry configuration.
- [Toolbar](https://geoman.io/docs/leaflet/toolbar): controls and options.
- [Drawing](https://geoman.io/docs/leaflet/modes/draw-mode) and [editing](https://geoman.io/docs/leaflet/modes/edit-mode): methods, options and events.
- [Layer groups](https://geoman.io/docs/leaflet/layer-groups): managing imported GeoJSON and drawn layers.

## Integrate

Load Leaflet and Geoman CSS. Initialize on a mounted container with an explicit height. In SSR applications, create maps on the client. Import the chosen Geoman plugin after Leaflet; do not load Free and Pro together.

Use the documented methods for the installed version. Keep application state in sync with creation, edits and removal, rather than saving only new shapes. Preserve feature properties and distinguish circles or plugin-specific metadata from standard GeoJSON geometry. Export the intended editable layers, excluding tile layers and temporary drawing helpers.

On unmount, remove listeners and the map. For React, verify that development remounts do not create duplicate maps or listeners. Check drawing, editing, deletion and GeoJSON round-tripping in the actual application.

Features marked ⭐ in the documentation require Pro. Check the installed edition before recommending them; keep the user's registry credentials out of generated code and tool requests. Pricing and license scope are at https://geoman.io/pricing.
