# L7-draw **Repository Path**: antv/L7-draw ## Basic Information - **Project Name**: L7-draw - **Description**: 基于 L7 封装的地理绘制库 - **Primary Language**: Zephir - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-01-24 - **Last Updated**: 2024-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # L7Draw > 基于 [L7](https://l7.antv.vision/zh) 封装的地理绘制库,支持在地图上通过单击、拖拽等方式绘制点、线、面的 GeoJSON 的数据 [](https://www.npmjs.com/package/@antv/l7-draw) [](https://www.npmjs.com/package/@antv/l7-draw) [文档](https://antv.vision/L7Draw/docs/draw/point) · [示例](https://antv.vision/L7Draw/example/point/start) ## 🔨 工具 基于 L7Draw 的面向 GeoJSON 编辑工具 [L7Editor](https://l7editor.antv.antgroup.com/) 已上线,欢迎尝鲜~。 ## 📦 安装 ```bash npm install -S @antv/l7-draw ``` ## 🔨 使用 ### 通过 NPM 引入 ```tsx | pure // ----js----- import { GaodeMap, Scene } from '@antv/l7'; import { DrawEvent, DrawPoint } from '@antv/l7-draw'; const scene = new Scene({ id: 'map', map: new GaodeMap({}), }); scene.on('loaded', () => { // 实例化 Draw const draw = new DrawPoint(scene, { editable: false, // Draw 配置 }); // 调用 Draw 上的方法 draw.enable(); // 监听 Draw 的事件 draw.on(DrawEvent.Add, (newPoint) => { console.log(newPoint); }); }); // ----html----
; ``` ### 通过 CDN 引入 ```html | pure ``` ## ⌨️ 本地开发 ```bash # 安装依赖 npm install # 运行页面 npm run start # 打包 npm run build ``` ## 💬 答疑 在使用 L7Draw 过程中,若有疑惑无法在文档中解决的可以扫码加入 L7 官方答疑群。