1.0.16 • Published 1 year ago

cesium-plot v1.0.16

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

安装

pnpm i cesium-plot@latest

静态资源

在index.html中全局引入Cesium

<link rel="stylesheet" href="./cesium/Widgets/widgets.css">
<script src="./cesium/Cesium.js"></script>

创建标绘对象

import {Plot} from "cesium-plot"
const viewer = new Cesium.Viewer("cesiumContainer")
const plot = new Plot({viewer})

常用API

方法名称参数说明
changeMode(String,Boolean)=>void第一个参数是模式,不填写默认Select,第二个参数用来控制是否连续绘制,默认为true,连续绘制模式
export()=>GeoJson[]导出标绘的数据,符合Geojson格式的数据
load(geojson)=>void导入一组符合Geojson格式的数据,回显图元
removeAll()=>void清除所有图元
updateEntityStyle(style)=>void更新选中的图元样式

模式

模式说明
Point
Polyline线
Polygon
Label文字
LabelClamp贴地文字
PolygonArrow箭头
Pencil画笔
Select选中模式,即普通模式,可以选中绘制的图元,对选中的图元进行拖拽等操作

回调监听

const plot = new Plot({viewer})
//创建结束 监听
plot.on('created', (plotObj: { geojson: { [key: string]: any } }) => {
  isEdit.value = true
  const { geojson } = plotObj
  const { properties, featureConstructorName, id } = geojson
  const { style } = properties
  currentPlot.value = id
  propsType.value.type = featureConstructorName
  propsType.value.propsConfig = style
})
1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.10

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago