Code Monkey home page Code Monkey logo

gl-draw-foxgis's Introduction

gl-draw-foxgis.js

基于 mapbox-gl-draw 0.16.0版本修改,支持在 mapbox-gl.js 地图中添加和编辑要素,除了添加点、线、面以外,支持在地图上绘制Bezier曲线、圆弧、圆、矩形、三角形、箭头、弯曲箭头等形状.

安装

npm install wanyanyan/gl-draw-foxgis

mapbox-gl 之后添加或包含 gl-draw-foxgis .

同时也需要添加 gl-draw-foxgis.css的引用

<link href="gl-draw-foxgis.css" rel="stylesheet" />

在应用程序中使用

mapboxgl.accessToken = 'YOUR_ACCESS_TOKEN';

var map = new mapboxgl.Map({
  container: 'map',
  style: 'mapbox://styles/mapbox/streets-v8',
  center: [40, -74.50],
  zoom: 9
});

var Draw = new MapboxDraw();

map.addControl(Draw)

可以从 API.md 获得完整的API参考.

开发或测试

安装所有依赖项, 编译源文件并启动测试服务:

git clone [email protected]:wanyanyan/gl-draw-foxgis.git
npm install
npm start & open http://localhost:9966/debug/?access_token=<token>

运行测试

npm run test

gl-draw-foxgis's People

Contributors

wanyanyan avatar zerocodelin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.