{"id":41305,"library":"jakodev-test-lfdraw","title":"jakodev-test-lfdraw (fork of Leaflet.FreeDraw)","description":"A Leaflet plugin for free-hand drawing, editing, and merging of polygons on map layers. Version 2.8.8 is the current stable release; it is a fork based on ale-leaflet (itself a fork of Leaflet 1.x). It provides an intuitive UX for creating geospatial boundaries with features like polygon concave hull, simplification, edge addition, and shape modification. Compared to alternatives like L.Pather (polylines), FreeDraw focuses on polygon workflows. It depends on jakodev-test-lf (Leaflet fork) as a peer dependency and ships as ESM primarily. Release cadence is irregular; no recent updates since 2021.","status":"active","version":"2.8.8","language":"javascript","source_language":"en","source_url":"https://github.com/jakodev/jakodev-test-lfdraw","tags":["javascript","leaflet","freedraw","polygon","drawing","freehand"],"install":[{"cmd":"npm install jakodev-test-lfdraw","lang":"bash","label":"npm"},{"cmd":"yarn add jakodev-test-lfdraw","lang":"bash","label":"yarn"},{"cmd":"pnpm add jakodev-test-lfdraw","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency; provides the L.Map, L.Layer, and SVG rendering that FreeDraw extends.","package":"jakodev-test-lf","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require() will fail.","wrong":"const FreeDraw = require('jakodev-test-lfdraw')","symbol":"FreeDraw","correct":"import FreeDraw from 'jakodev-test-lfdraw'"},{"note":"FreeDraw is a default export, not a named export. Named import will result in undefined.","wrong":"import { FreeDraw } from 'jakodev-test-lfdraw'","symbol":"FreeDraw (as default)","correct":"import FreeDraw from 'jakodev-test-lfdraw'"},{"note":"This plugin requires the specific jakodev-test-lf (Leaflet fork), not the original leaflet package, due to internal API differences.","wrong":"import L from 'leaflet'","symbol":"L","correct":"import L from 'jakodev-test-lf'"}],"quickstart":{"code":"import L from 'jakodev-test-lf';\nimport FreeDraw from 'jakodev-test-lfdraw';\n\nconst map = new L.Map('map', {\n  center: [51.505, -0.09],\n  zoom: 13\n});\n\nconst freeDraw = new FreeDraw();\nmap.addLayer(freeDraw);\n\nfreeDraw.on('markers', event => {\n  console.log('Polygon created/edited:', event.latLngs);\n});\n\n// Optionally set mode: ALL, NONE, CREATE, EDIT, DELETE, APPEND, or EDIT_CREATE\nfreeDraw.setMode(FreeDraw.MODES.CREATE);","lang":"javascript","description":"Shows basic setup: import the Leaflet fork and FreeDraw, initialize map, add FreeDraw layer, listen for marker events, and set mode."},"warnings":[{"fix":"Replace 'leaflet' with 'jakodev-test-lf' in your package.json and imports.","message":"Requires specific Leaflet fork (jakodev-test-lf), not the official leaflet package. Using official Leaflet will cause runtime errors or missing methods.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use 'jakodev-test-lfdraw' instead of 'leaflet-freedraw'.","message":"The original Leaflet.FreeDraw (npm: leaflet-freedraw) is deprecated in favor of this fork. However, documentation may still reference the old package.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Change 'require' calls to ES module imports, or use dynamic import: const FreeDraw = (await import('jakodev-test-lfdraw')).default;","message":"ESM-only package. If your project uses CommonJS (require), you must use dynamic import() or switch to ESM.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Attach the event listener directly to the FreeDraw instance: freeDraw.on('markers', ...);","message":"The 'markers' event fires on the freeDraw instance, not on the map. Listening on map will not work.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure target browsers support SVG, or use a polyfill.","message":"FreeDraw internally uses SVG; it may not work in browsers that lack SVG support (very old browsers).","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'1':45 '2.8.8':25 '2021':105 'addit':64 'ale':38 'ale-leaflet':37 'altern':70 'base':35 'boundari':55 'cadenc':98 'compar':68 'concav':60 'creat':53 'current':28 'depend':80,91 'draw':15,110 'edg':63 'edit':16 'esm':95 'featur':57 'focus':75 'fork':5,34,42,87 'free':13 'free-hand':12 'freedraw':74,108 'freehand':111 'geospati':54 'hand':14 'hull':61 'intuit':50 'irregular':100 'jakodev':2,83 'jakodev-test-lf':82 'jakodev-test-lfdraw':1 'javascript':106 'l.pather':72 'layer':23 'leaflet':9,39,44,86,107 'leaflet.freedraw':7 'lf':85 'lfdraw':4 'like':58,71 'map':22 'merg':18 'modif':67 'peer':90 'plugin':10 'polygon':20,59,77,109 'polylin':73 'primarili':96 'provid':48 'recent':102 'releas':30,97 'shape':66 'ship':93 'simplif':62 'sinc':104 'stabl':29 'test':3,84 'updat':103 'ux':51 'version':24 'workflow':78 'x':46","created_at":"2026-06-04T18:51:46.027809+00:00","updated_at":"2026-06-04T18:51:46.027809+00:00","problems":[{"fix":"Install and import from 'jakodev-test-lf' instead of 'leaflet'.","cause":"Importing 'leaflet' instead of 'jakodev-test-lf' leads to missing or incompatible L.Map class.","error":"TypeError: Cannot read properties of undefined (reading 'addLayer')"},{"fix":"Use 'jakodev-test-lf' as the Leaflet fork dependency.","cause":"Outdated documentation references the original 'ale-leaflet' package name.","error":"Module not found: Can't resolve 'ale-leaflet'"},{"fix":"Change import to: import FreeDraw from 'jakodev-test-lfdraw';","cause":"Using named import ({ FreeDraw }) instead of default import.","error":"Warning: FreeDraw is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jakodev/jakodev-test-lfdraw","github":"https://github.com/jakodev/jakodev-test-lfdraw","docs":null,"changelog":null,"pypi":null,"npm":"jakodev-test-lfdraw","openapi_spec":null,"status_page":null,"smithery":null,"categories":["maps"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}