Leaflet plugin for rendering animated migration lines (arcs with flowing markers and pulse effects) on maps. Version 2.3.8 ships TypeScript types, supports data-driven styling via line width, color, marker radius, and pulse animation. Commonly used to visualize movement flows, migration patterns, or travel routes. Released as an ES module and can be imported directly after npm install. Maintained by lin-123 on GitHub with a live demo.
npm install leaflet.migrationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a Leaflet map, defines migration data with from/to coordinates and a color, creates a migration layer with pulse markers and arrow line icons, and adds it to the map.
Ensure your tsconfig includes 'types': ['leaflet', 'leaflet.migration'] or augment the L interface manually.
Ensure the returned Element is appended to the DOM if not already present, or use a container that stays in the DOM.
Set minZoom: 0 if you need the layer at all zoom levels.
Remove any default import like `import migration from 'leaflet.migration'`; use side-effect import.
Use `import 'leaflet.migration'` before calling L.migrationLayer.
Run `npm install leaflet.migration` and ensure import path is 'leaflet.migration'.
Install @types/leaflet if not present, and add a declaration file or use `declare module 'leaflet' { ... }`.