Pre-release

Drawing & editing tools for Leaflet

Vectorstream adds drawing and editing tools to your web map. Draw, edit, move, rotate and snap shapes, then read everything back as GeoJSON.

LeafletOpenLayersMapLibre GLGeoJSON

Beyond drawing

The details that make GIS editing feel right.

01

Snapping

New points snap onto nearby corners and edges while you draw. Hold Alt to turn snapping off.

02

Live measurements

While you draw a polygon, the length of the current side, the perimeter and the area update with every move of the pointer.

03

Cut

Draw a shape across the outer edge of an area and the cut tool removes the strip it covers. The strip does not stay as a shape, and a shape in the middle of an area is rejected.

04

Union

The union tool merges areas that share at least one edge into one area. Areas that are not neighbours are rejected.

05

Lasso

Draw a loop with the lasso to select areas. Every area the loop encloses completely is selected; an area it only crosses is not.

Want to try it yourself? The playground runs the real editor, right in the page.

Open the playground

Integration

Add the editor to your map, listen for events.

Vectorstream hooks into the map you already have. Every edit ends in one of three events: change, unchanged or rejected.

The packages are not published yet. These excerpts are taken from the quickstarts in the docs.

Read the docs
leaflet-quickstart.ts
import L from 'leaflet';
import { exportGeoJSON, importGeoJSON, type FeatureCollection } from '@vectorstream/core';
import { Editor, Toolbar, defaultToolbarEntries } from '@vectorstream/editor';
import { LeafletAdapter } from '@vectorstream/leaflet';

export function startEditor(container: HTMLElement, data: FeatureCollection) {
  const map = L.map(container).setView([51.5112, 7.4555], 17);

  const adapter = new LeafletAdapter(map);

  const editor = new Editor(importGeoJSON(data), adapter);
  const toolbar = new Toolbar(editor, defaultToolbarEntries());
  toolbar.select('draw');

  editor.on('change', ({ label }) => console.log('changed:', label));
  editor.on('unchanged', ({ label }) => console.log('nothing to do:', label));
  editor.on('rejected', ({ label, violations }) => {
    console.warn('rejected:', label, violations.map((v) => v.detail));
  });

  return {
    editor,
    save: (): FeatureCollection => exportGeoJSON(editor.partition),
  };
}

Solutions

Built for work where neighbours share a border.

Parcels, zones, stands and lease areas: see how each field uses vectorstream.

Cadastre & Land RegistryEdit parcel boundaries where neighbouring parcels share one line, so a corrected border updates both sides and never opens a gap.Urban & Regional PlanningSketch zoning districts, land-use areas and development blocks that tile without gaps, and keep plan variants as separate documents in the browser.Utilities & Network OperationsMaintain service areas, pressure zones and supply districts with shared borders, and sketch pipe or cable routes that snap to existing corners.Infrastructure & Field OpsPlan work zones, closures and inspection sections on a web map, with tools that snap to existing edges and an undo that restores every step.Agriculture & Parcel ManagementMap fields, management zones and margin strips that share their borders, and split or merge fields as the crop plan changes from season to season.Forestry & Land ManagementKeep forest compartments, stands and harvest blocks in one connected map, where redrawing a stand boundary also updates the stand next to it.Real Estate & PropTechLet users outline plots, assemble sites from neighbouring lots and sketch building footprints inside your property app, then save the result as GeoJSON.GIS & Location IntelligenceBring topology-aware polygon editing to a web GIS: shared edges, exact undo, tracing, snapping and checked GeoJSON on Leaflet, OpenLayers or MapLibre GL.Mapping Product BuildersEmbed point, line and polygon editing in your SaaS product, with shared borders, exact undo and GeoJSON output that your users never have to think about.Government & Public AdministrationMaintain districts, catchments and permit areas whose borders are shared, with exact undo and GeoJSON exchange for the systems you already run.Emergency & Public SafetyDraw evacuation zones, cordons and search sectors that share their borders, and adjust them quickly with an undo that restores the exact previous layout.Energy & RenewablesPlan solar and wind sites across landowner parcels: lease areas that share borders, exclusions cut off at the site edge, and array blocks copied into place.Environmental & ConservationMap habitats, protected-area zones and restoration sites as connected polygons, and draw survey plots and transects on the same map.Drones & Airspace ZonesDraw no-fly zones, geofences and flight-restriction areas for drone operations, keep adjoining zones flush and export the polygons as GeoJSON.Micromobility & Shared Mobility ZonesDraw parking spots, no-parking, no-ride and slow zones for e-scooters and shared bikes, per city and per operator, with borders that stay flush.Delivery Zones & LogisticsDivide a region into delivery areas, courier zones and depot catchments that tile without gaps or overlaps, and move one shared line to rebalance them.Parking & Traffic ManagementMaintain parking zones, permit areas, loading bays and low-emission or access zones at city level, with shared borders and GeoJSON exchange.View all solutionsEvery industry on one page, with use cases, workflows and answers.

Pricing

Free for the editor, Pro for the rules.

Every tool and the topology are free under the MIT license. Pro adds ten more kinds of rule between layers, the red preview, the list of violations and more. Pro is priced on request.

FreeFor every project, with no key and no registration
ProFor teams that check rules between layers

FAQ

Questions

The questions asked most often. Every other answer is on the FAQ page.

What is vectorstream?
vectorstream is a geometry editor for web maps. Areas, lines and points are drawn and edited on a Leaflet, OpenLayers or MapLibre GL map, and where two areas meet, vectorstream stores their border once, so an edit on one side is an edit on both. Shapes go in and out as GeoJSON.
What happens to a shared border when I move it?
vectorstream stores the border between two neighbouring areas as one shared edge. Dragging a corner or an edge of that border changes both areas in the same step, so no gap or overlap can open between them.
Which map libraries does vectorstream support?
vectorstream has adapters for Leaflet, OpenLayers and MapLibre GL, and all three run the same editing core, so the tools behave alike on each.
How do I export my work from vectorstream?
vectorstream exports a document as one GeoJSON FeatureCollection: areas become Polygon features, lines become LineString features and points become Point features, with their attributes as properties. Each feature also carries the id and the name of its layer, so importing the file into vectorstream again restores the layers.
Is there a free version?
Yes. The free packages of vectorstream are under the MIT license and hold all tools, the topology, GeoJSON and image export, the three map adapters, the toolbar, five languages and two kinds of rule between layers, without a license key.
What does vectorstream Pro add to the free editor?
vectorstream Pro adds ten more kinds of rule between layers, attribute conditions, rules measured in meters, the red preview, the list of violations, snapping onto the target layers, the incremental check and the circle as a cutting shape. Pro plugs into the free editor, and its license check makes no network call.

See all questions

Put a drawing toolkit on your map.