antv-l7/packages/draw
thinkinggis 154e32431e fix(heatmap): 修复热力图某些设备上黑色 fix #278 2020-04-09 20:54:39 +08:00
..
__tests__/util Merge branch 'master' into l7-draw 2020-04-07 11:27:21 +08:00
src fix(heatmap): 修复热力图某些设备上黑色 fix #278 2020-04-09 20:54:39 +08:00
CHANGELOG.md chore: publish 2020-04-07 11:51:55 +08:00
README.md refactor(draw): 增加键盘事件& control移除方法 2020-04-08 14:06:02 +08:00
package.json refactor: amap draw 事件问题 2020-04-07 20:18:43 +08:00
rollup.config.js fix(heatmap): 修复热力图某些设备上黑色 fix #278 2020-04-09 20:54:39 +08:00
tsconfig.build.json improvement: click & doubclick use hammer 2020-03-17 18:37:34 +08:00

README.md

draw

地图绘制组件,支持点、线、面的绘制编辑,

使用

l7-draw 需要引用

import { DrawControl } from '@antv/l7-draw';

CDN 版本引用

<head>
<! --引入最新版的L7-Draw --> 
<script src = 'https://unpkg.com/@antv/l7-draw'></script>
</head>

example


import { Scene } from '@antv/l7';
import { GaodeMap, Mapbox } from '@antv/l7-maps';
import { DrawControl } from '@antv/l7-draw';
const scene = new Scene({
      id: 'map',
      map: new GaodeMap({
        pitch: 0,
        style: 'dark', // hosted style id
        center: [112.874, 32.76], // starting position
        zoom: 12, // starting zoom
      }),
    });
    this.scene = scene;

    scene.on('loaded', () => {

      const drawControl = new DrawControl(scene, {
        position: 'topright',
        layout: 'horizontal', // horizontal vertical
        controls: {
          point: true,
          polygon: true,
          line: true,
          circle: true,
          rect: true,
          delete: true,
        },
      });
      scene.addControl(drawControl);
    });