New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

leaflet-polydraw

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-polydraw

Advanced Leaflet plugin for freehand polygon drawing, with smart merging and powerful editing tools. Compatible with both Leaflet v1.x and v2.x.

latest
Source
npmnpm
Version
1.3.3
Version published
Maintainers
1
Created
Source

Leaflet Polydraw

Leaflet Polydraw

A modern Leaflet plugin for intuitive freehand polygon drawing and advanced spatial editing — fully compatible with Leaflet 1.x and 2.x.

Live Demo: https://polydraw.ao-tech.se

Advanced Leaflet plugin for freehand polygon drawing, with smart merging and powerful editing tools

Leaflet.Polydraw lets you draw polygons directly on Leaflet maps in a natural freehand way — click and drag to sketch shapes.
It also supports point-to-point precision drawing, intelligent polygon merging, drag-and-drop repositioning, and a rich set of editing tools.
This makes it ideal for GIS platforms, mapping applications, and spatial data workflows.

npm License: MIT TypeScript CI

---4

Key Features

Feature Overview

  • Freehand Drawing: Draw polygons naturally by sketching directly on the map — click and drag to create shapes in real time.
  • Smart Polygon Merging: Automatically detects and merges overlapping polygons (including smooth C-to-O shape completion).
  • Drag & Drop Editing: Intuitive polygon repositioning with intelligent spatial interactions.
  • Clone Drag Mode: Duplicate polygons instantly by dragging a copy while the original remains in its starting position (preserves holes and metadata).
  • Advanced Vertex Editing: Drag vertices, add or remove points, and reshape polygons seamlessly.
  • Scaling & Rotation Handles: Transform polygons visually using interactive bounding boxes — scale, rotate, or stretch with precision.
  • Undo & Redo History: Full action history with reversible edits — step backward or forward through vertex moves, shape changes, merges, and freehand strokes (Ctrl/Cmd+Z, Ctrl+Y or Cmd+Shift+Z).
  • Point-to-Point Mode: Optional precise vertex-by-vertex drawing for detailed or structured geometry.
  • Hole Support: Create complex polygons with holes and nested structures effortlessly.
  • Smart Markers: Adaptive marker placement prevents overlaps and maintains visual clarity.
  • Modifier Shortcuts: Hold Ctrl or Cmd (or user-defined keys) to temporarily switch to subtract while drawing or in point-to-point draw mode (modifierSubtractMode).
  • Performance Optimized: Efficient rendering and event handling even for large datasets.
  • GeoJSON Import: Add Polygon and MultiPolygon features directly from RFC 7946 GeoJSON
  • Coordinate Auto-Detection: Accepts multiple coordinate formats automatically (lat/lng, DMS, DDM, N/E, etc.).
  • Leaflet 1.x & 2.x Compatible: Fully compatible with both generations of the Leaflet API.
  • TypeScript Ready: Includes complete type definitions for modern development workflows.

Live Demo · Quick Start · Full Documentation

Documentation

Full documentation and examples are available on GitHub:

Disclaimer

This project is provided "as is", without any warranty or guarantee of any kind. See the MIT License for full terms.

Keywords

leaflet

FAQs

Package last updated on 13 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts