Skip to content
🎨 | openalyers扩展标绘
Branch: feature/v3
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build add: demo Apr 9, 2019
examples add: demo Apr 9, 2019
src refactor: ol5 Apr 9, 2019
.editorconfig # 准备升级第三版 Aug 17, 2017
.eslintignore # update readme Jan 10, 2018
.eslintrc.js # update readme Jan 10, 2018
.gitignore # update readme Jan 10, 2018
.npmignore # update readme Jan 10, 2018
.travis.yml # update readme Jan 10, 2018
CHANGELOG.md
CONTRIBUTING.md # edit webpack and add changelog Aug 28, 2017
LICENSE
README.md edit: readme Apr 9, 2019
babel.config.js add: demo Apr 9, 2019
package.json refactor: ol5 Apr 9, 2019
yarn.lock add: demo Apr 9, 2019

README.md

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 当前激活的文本框事件 --
You can’t perform that action at this time.