Giter Site home page Giter Site logo

ol-plot's Introduction

openlayers 扩展标绘V3.0.0

This item has been turned into internal maintenance and this warehouse is no longer updated.

Build Status NPM downloads JS gzip size Npm package GitHub stars GitHub license

军事标绘功能,支持openlayers5。

build

重要: Github 仓库的 /dist 文件夹只有在新版本发布时才会更新。如果想要使用 Github 上最新的源码,你需要自己构建。


git clone https://github.com/sakitam-fdd/ol-plot.git
npm run dev
npm run build
npm run demo

Use

new olPlot.(map) 初始化标绘绘制工具

CDN

https://unpkg.com/ol-plot/dist/ol-plot.js
https://unpkg.com/ol-plot/dist/ol-plot.css

NPM

npm install ol-plot --save
import olPlot 'ol-plot'

Examples

demo

其他示例请参看examples文件夹

plotDraw Methods

activate(type)

激活标绘工具

Parameters:
key type desc
type string 标绘符号类型
type

标绘类型

type:
key type desc
olPlot.PlotTypes.ARC string 弓形
olPlot.PlotTypes.ELLIPSE string 椭圆
olPlot.PlotTypes.CURVE string 曲线
olPlot.PlotTypes.CLOSED_CURVE string 闭合曲面
olPlot.PlotTypes.LUNE string 弓形
olPlot.PlotTypes.SECTOR string 扇形
olPlot.PlotTypes.GATHERING_PLACE string 集结地
olPlot.PlotTypes.STRAIGHT_ARROW string 细直箭头
olPlot.PlotTypes.ASSAULT_DIRECTION string 粗单直箭头
olPlot.PlotTypes.ATTACK_ARROW string 进攻方向
olPlot.PlotTypes.TAILED_ATTACK_ARROW string 进攻方向(尾)
olPlot.PlotTypes.SQUAD_COMBAT string 战斗行动
olPlot.PlotTypes.TAILED_SQUAD_COMBAT string 分队战斗行动(尾)
olPlot.PlotTypes.FINE_ARROW string 粗单尖头箭头
olPlot.PlotTypes.CIRCLE string
olPlot.PlotTypes.DOUBLE_ARROW string 双箭头
olPlot.PlotTypes.POLYLINE string 线
olPlot.PlotTypes.FREEHAND_LINE string 自由线
olPlot.PlotTypes.POLYGON string
olPlot.PlotTypes.FREEHAND_POLYGON string 自由面
olPlot.PlotTypes.RECTANGLE string 矩形
olPlot.PlotTypes.MARKER string
plotDraw.on('drawEnd', onDrawEnd, this)

监听符号结束绘制

Parameters:
key type desc
type String 事件类型,目前包括开始和结束事件
onDrawEnd Function 事件的回调函数
this Object 上下文,可不传
setMap(map)

设置当前地图实例

Parameters:
key type desc
map ol.Map 地图实例

plotEdit Methods

activate(feature)

激活标绘编辑工具

Parameters:
key type desc
feature ol.Feature 要激活的标绘符号
deactivate()

取消符号的编辑状态

setMap(map)

设置当前地图实例

Parameters:
key type desc
map ol.Map 地图实例

PlotUtils Methods

方法 说明 参数
getFeatures 序列化地图上所有符号 --
addFeatures 反序列化保存的符号 features : Array
removeAllFeatures 删除所有符号 --

Events

plotDraw on
事件监听名 说明 参数
drawEnd draw结束事件 --
active_textArea 当前激活的文本框事件 --

ol-plot's People

Contributors

sakitam-fdd 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.