Google deprecated the Drawing Library of the Maps JavaScript API in August 2025, and it has been unavailable since May 2026. google.maps.drawing.DrawingManager no longer works, so any app that let users draw polygons, circles or markers on a Google map needs a replacement. Google's deprecations page says affected applications "need to switch to using alternatives", and names Terra Draw as an example.
This guide compares the options and shows how DrawingManager code maps to Geoman.
Your options
1. Stay on Google Maps and use Terra Draw. Google's own Terra Draw example adds drawing to a Google map. This is the smallest change if your app depends on Google's basemap, Places or Street View.
2. Move the map to Leaflet or MapLibre and use Geoman. If drawing and editing are central to your product, this gives you a full editing toolkit: snapping, vertex editing, dragging, rotation, cutting, and with Pro, splitting, measurements and auto tracing. It also takes your map off Google's per-load billing. You need a non-Google tile source, because Google's basemap is tied to Google's own APIs and terms.
There was no separate price for the Drawing Library. You paid for Maps JavaScript API map loads, and that does not change if you stay on Google Maps.
DrawingManager to Geoman API mapping
The left column is the old Google code. The right columns are the Leaflet-Geoman and MapLibre-Geoman equivalents.
| Task | Google DrawingManager | Leaflet-Geoman | MapLibre-Geoman |
|---|---|---|---|
| Add drawing tools | new google.maps.drawing.DrawingManager({ drawingControl: true }).setMap(map) |
map.pm.addControls() |
new Geoman(map, options) |
| Limit the tools | drawingControlOptions: { drawingModes: [...] } |
map.pm.addControls({ drawCircle: false, ... }) |
controls in the Geoman options |
| Start drawing a polygon | drawingManager.setDrawingMode(OverlayType.POLYGON) |
map.pm.enableDraw("Polygon") |
map.gm.enableDraw("polygon") |
| Stop drawing | drawingManager.setDrawingMode(null) |
map.pm.disableDraw() |
map.gm.disableDraw() |
| Shape style | polygonOptions: { fillColor, strokeColor } |
map.pm.setPathOptions({ color, fillColor }) |
Style options in the Geoman options |
| Shape finished | overlaycomplete (or polygoncomplete, circlecomplete) |
pm:create with e.shape and e.layer |
gm:create |
| Make a shape editable | polygon.setEditable(true) |
layer.pm.enable() or map.pm.enableGlobalEditMode() |
map.gm.enableGlobalEditMode() |
| Shape edited | insert_at, set_at, remove_at on the path |
pm:edit on the layer |
gm:editend |
| Circle center and radius | circle.getCenter(), circle.getRadius() |
layer.getLatLng(), layer.getRadius() |
Circle feature in the export |
| Save as GeoJSON | Convert overlays yourself | map.pm.getGeomanLayers(true).toGeoJSON() |
map.gm.features.exportGeoJson() |
Shape names map directly: Google's MARKER, POLYLINE, POLYGON, RECTANGLE and CIRCLE are Geoman's Marker, Line, Polygon, Rectangle and Circle.
Example: from DrawingManager to Leaflet-Geoman
Before:
const drawingManager = new google.maps.drawing.DrawingManager({
drawingMode: google.maps.drawing.OverlayType.POLYGON,
drawingControl: true,
polygonOptions: { fillColor: "#3388ff", editable: true },
})
drawingManager.setMap(map)
google.maps.event.addListener(drawingManager, "overlaycomplete", (event) => {
save(event.type, event.overlay)
})
After, with Leaflet 1.9 and Leaflet-Geoman Free:
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"
const map = L.map("map").setView([51.505, -0.09], 13)
// Add a tile layer from your provider here.
map.pm.addControls({ position: "topleft", drawCircleMarker: false })
map.pm.setPathOptions({ color: "#3388ff", fillColor: "#3388ff" })
map.pm.enableDraw("Polygon")
map.on("pm:create", ({ shape, layer }) => {
layer.on("pm:edit", () => save(map.pm.getGeomanLayers(true).toGeoJSON()))
save(map.pm.getGeomanLayers(true).toGeoJSON())
})
Geoman shapes are editable from the toolbar, so you no longer need editable: true on each one. Saving GeoJSON replaces the code that read paths from Google overlays.
Migration checklist
- Export the shapes your users already drew, from your database or by converting Google overlays to GeoJSON.
- Pick a map library: Leaflet vs MapLibre explains the trade-offs.
- Pick a tile source and add its attribution. See are Leaflet and MapLibre free? for what costs money.
- Install Geoman: Leaflet or MapLibre and Mapbox.
- Import your GeoJSON, then test drawing, editing, deleting and saving with real data.
To see the tools before you write code, try the Leaflet demo or the drawing tools example.