npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ol-plot-enhanced

v0.1.0

Published

ol plot enhanced

Downloads

7

Readme

openlayers 扩展标绘V3.0.0

Forked from https://github.com/sakitam-fdd/ol-plot

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。

what's enhanced?

  • 增加了删除单个 feature 的方法
  • 增加了 plot 文字 label 的支持

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 | 当前激活的文本框事件 | -- |