ZOYKU火線榜

geoman-io/leaflet-geoman技術文件

The most powerful leaflet plugin for drawing and editing geometry layers

多語言回退提示:當前倉庫原作者暫未發布在地化文件,已為您無縫切換至官方英文原版(English),排版及程式碼實例完整保真。
npm i leaflet-geoman

Geoman Logo

Leaflet-Geoman

Leaflet Plugin For Creating And Editing Geometry Layers
Draw, Edit, Drag, Cut, Rotate, Split, Scale, Measure, Snap and Pin Layers
Supports Markers, CircleMarkers, Polylines, Polygons, Circles, Rectangles, ImageOverlays, LayerGroups, GeoJSON, MultiLineStrings and MultiPolygons

npm version NPM Downloads

Demo

Documentation

Visit geoman.io/docs to get started.

Demo

Check out the full power of Leaflet-Geoman Pro on geoman.io/demo

Feature Requests

I'm adopting the Issue Management of lodash which means, feature requests get the "Feature Request" Label and then get closed.
You can upvote existing feature requests (or create new ones). Upvotes make me see how much a feature is requested and prioritize their implementation.
Please see the existing Feature Requests here and upvote if you want them to be implemented.

Developing

This project uses mise to pin Node.js and pnpm. Clone the repository, install the declared tools, and then install all packages:

mise install
pnpm install

Compile and run dev watch version:

pnpm start

Compile and run build version:

pnpm run prepare

Run tests:

pnpm test            # E2E tests (Cypress)
pnpm run test:unit   # Unit tests (Vitest)

Open cypress window:

pnpm run cypress

Lint and format (oxlint + oxfmt):

pnpm run lint

Take a look into CONTRIBUTING

Credit

A big thanks goes to @Falke-Design, he invests a lot of time and takes good care of Leaflet-Geoman.

Thanks to @ryan-morris for the implementation of Typescript and support with Typescript questions.

As I never built a leaflet plugin before, I looked heavily into the code of leaflet.draw to find out how to do stuff. So don't be surprised to see some familiar code.

I also took a hard look at the great L.GeometryUtil for some of my helper functions.

The Rotate Mode are only working because of the great calculation code of L.Path.Transform

文件鏡像歸檔自 GitHub 官方源路徑 · 造訪原專案 GitHub
最後同步快照:2026-11-09