1 Star 0 Fork 0

黑夜行 / L7-draw

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

L7Draw

基于 L7 封装的地理绘制库

npm Version npm Download Status Percentage of issues still open Average time to resolve an issue

📚 文档

文档 示例

🔨 工具

基于 L7Draw 的面向 GeoJSON 编辑工具 L7Editor 已上线,欢迎尝鲜~。

📦 安装

npm install @antv/l7-draw

🔨 使用

通过 NPM 引入

// ----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----
<div id="map"></div>;

通过 CDN 引入

<!-- 引入依赖包 -->
<script src="https://unpkg.com/@antv/l7"></script>
<script src="https://unpkg.com/@antv/l7-draw"></script>

<script>
  const scene = new L7.Scene({
    id: 'map',
    map: new L7.GaodeMap({
      style: 'dark',
      center: [104.288144, 31.239692],
      zoom: 4.4,
    }),
  });
  scene.on('loaded', () => {
    // 通过 L7.Draw.*** 访问
    const draw = new L7.Draw.DrawPoint(scene, {});
    draw.enable();
  });
</script>

⌨️ 本地开发

# 安装依赖
npm install

# 运行页面
npm run start

# 打包
npm run build

💬 答疑

在使用 L7Draw 过程中,若有疑惑无法在文档中解决的可以扫码加入 L7 官方答疑群。

🤝 如何贡献

如果您在使用的过程中碰到问题,可以先通过 issues 看看有没有类似的 bug 或者建议。

📖 许可证

MIT@AntV.

The MIT License (MIT) Copyright (c) 2021 AntV Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

L7 绘制控件 展开 收起
TypeScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/ojh496845051/L7-draw.git
git@gitee.com:ojh496845051/L7-draw.git
ojh496845051
L7-draw
L7-draw
master

搜索帮助