Terra Draw
Multi-library drawing tool
Maintained by James Milner
A cross-library drawing tool that works with MapLibre GL JS, Leaflet, OpenLayers, and Google Maps. Draw and edit geometries with a consistent API.
Live demo
Terra Draw running on MapLibre GL JS in your browser
Loading the map…
Demo code
import { TerraDraw, TerraDrawPolygonMode, TerraDrawSelectMode } from "terra-draw";
import { TerraDrawMapLibreGLAdapter } from "terra-draw-maplibre-gl-adapter";
import type { PluginDemo } from "../types";
export default {
center: [-0.1276, 51.5072], // London
zoom: 14,
run({ map }) {
const draw = new TerraDraw({
adapter: new TerraDrawMapLibreGLAdapter({ map }),
modes: [
new TerraDrawPolygonMode(),
new TerraDrawSelectMode({
flags: {
polygon: {
feature: {
draggable: true,
coordinates: { midpoints: true, draggable: true, deletable: true },
},
},
},
}),
],
});
draw.start();
// One polygon to start with.
draw.addFeatures([
{
type: "Feature",
properties: { mode: "polygon" },
geometry: {
type: "Polygon",
coordinates: [
[
[-0.135, 51.5105],
[-0.12, 51.5105],
[-0.12, 51.504],
[-0.135, 51.504],
[-0.135, 51.5105],
],
],
},
},
]);
// Click the map to draw another polygon; click its first point to close it.
draw.setMode("polygon");
},
} satisfies PluginDemo;Used by 5 products


OpenStreetMap
Free wiki world map whose data is available under the ODbL, with whole-planet downloads, Shortbread vector tiles, and an editing API for contributing data back.


GeoLens
Open-source, self-hosted catalog for geospatial data with semantic search, OGC APIs, and a map builder for composing and sharing multi-layer maps.


fAIr
Open-source AI-assisted mapping tool by the Humanitarian OpenStreetMap Team for training AI models that detect buildings, roads, and trees in imagery, to help humanitarian mappers.

Mountaya
Mapping platform for race organizers, athletes, coaches, and outdoor apps, with Map Studio for designing activity-aware routes and courses, white-label map embeds, Outdoor Tiles, and a GraphQL API and MCP server.

Terrain Viewer
Free, open-source web tool for exploring, comparing, and exporting terrain visualizations such as hillshade, hypsometric tint, contours, slope, and sky-view factor over global and national elevation data.