Leaflet-Geoman vs Leaflet.draw
Both plugins add drawing and editing to Leaflet. Choose by the editing tools your users need, the APIs you maintain, and whether you need commercial support.
Written by Geoman. Reviewed September 26, 2026.
Free and Pro feature comparison
Leaflet.draw supplies drawing controls, editable feature groups and an extensible API. Leaflet-Geoman Free adds built-in snapping and geometry tools; Pro extends that set. The table describes the packages themselves. Third-party extensions can change what an application supports.
| Capability | Geoman Free | Geoman Pro | Leaflet.draw |
|---|---|---|---|
| Draw and edit | Markers, lines, polygons, rectangles and circles | Includes Free tools | Markers, lines, polygons, rectangles and circles |
| Snapping | Built in | Adds tools such as snap guides and pinning | Extensions or application code |
| Geometry operations | Drag, rotate and cut | Adds split, scale, union and difference | Editing and deletion; additional operations need extensions or application code |
| Measurements | Use your own calculation and display | Measurement tools while drawing and editing | Drawing measurements, including optional polygon area display |
| License | MIT | Commercial license | MIT |
Sources: Leaflet.draw documentation and license, Leaflet.draw API, and Geoman documentation (Pro features are marked with a star). Benchmark both with your own geometry sizes and devices; this comparison does not claim a measured performance advantage.
Migrate a Leaflet.draw editor to Geoman
Keep Leaflet and your application's GeoJSON storage. Replace the drawing control and event handlers, then test drawing, editing, deleting and saving. Remove the Leaflet.draw toolbar while testing Geoman so the two plugins do not compete for the same input.
- Install
leafletand@geoman-io/leaflet-geoman-free. - Create a map container with an explicit height, such as
<div id="map" style="height: 480px"></div>. - Use this module in a browser bundle such as Vite. In an SSR framework, initialize it after the component mounts.
import L from "leaflet"
import "leaflet/dist/leaflet.css"
import "@geoman-io/leaflet-geoman-free"
import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css"
export function createEditor(
container,
initialData = { type: "FeatureCollection", features: [] },
) {
const map = L.map(container).setView([0, 0], 2)
// Add your application's tile layer here.
const editableLayers = L.featureGroup().addTo(map)
L.geoJSON(initialData).eachLayer((layer) => editableLayers.addLayer(layer))
map.pm.setGlobalOptions({ layerGroup: editableLayers, snappable: true })
map.pm.addControls({
drawMarker: false,
drawCircleMarker: false,
drawCircle: false,
drawText: false,
cutPolygon: false,
rotateMode: false,
})
map.on("pm:remove", ({ layer }) => editableLayers.removeLayer(layer))
return { map, getData: () => editableLayers.toGeoJSON() }
}
Call const editor = createEditor("map", savedGeoJson), where savedGeoJson is your existing FeatureCollection. Call editor.getData() from
your Save action and persist the result through your own API. The example uses
a blank background; add your application's tile layer for geographic context.
The toolbar enables drawing and editing. For polygon drawing from your own
button, use editor.map.pm.enableDraw("Polygon"). To edit
existing geometry, use editor.map.pm.enableGlobalEditMode().
Call editor.map.remove() when your component unmounts.
Update your event handlers
draw:createdbecomes the map'spm:createevent.- For edits, attach
pm:editto each imported or newly created layer. This fires during editing; debounce automatic saves if needed. - Use
pm:removefor removal through Geoman. Programmatic changes in your application should also update your persistence layer.
This example keeps a feature group as the export boundary and turns off circle drawing: standard GeoJSON does not preserve a Leaflet circle's radius. Check feature IDs, custom properties, multi-geometries and any custom shapes in your own round-trip tests.
Continue with the installation guide, drawing API and editing events.
Choose the tools your workflow needs
An existing Leaflet.draw application may already cover your requirements. Evaluate Geoman Free when you want integrated snapping, rotation or cutting. Evaluate Pro when splitting, scaling, measurements or auto tracing would replace custom development. Try representative geometry and mobile interactions before making the switch.
Use the interactive demo to check the workflow, then review licensing and support options. The demo includes Pro capabilities; it is not a list of Free features.
Frequently asked questions
Is Leaflet-Geoman Free enough to draw and edit polygons?
Yes. Free includes polygon drawing, vertex editing, dragging, cutting, rotation and snapping. Pro adds tools such as splitting, scaling, measurements and auto tracing. Check the documentation for individual Pro options.
Is Leaflet-Geoman a drop-in replacement for Leaflet.draw?
No. Your Leaflet map and GeoJSON data can stay, but toolbar setup, event listeners and editing controls use different APIs. Test geometry round trips and application-specific behavior during migration.
Does Leaflet.draw support measurements?
Yes. Leaflet.draw provides drawing measurements, including optional polygon area display. Geoman Pro offers its own measurement tools for drawing and editing; compare the exact interaction your application requires.
Can I use either open-source plugin in a commercial application?
Both Leaflet.draw and Leaflet-Geoman Free use the MIT license. Geoman Pro requires a commercial license. Review the relevant license and test your application's requirements before choosing.
