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

cesium-plot

v1.0.16

Published

cesium基础标绘功能库,包含点线面、文字、贴地文字、箭头、画笔、导入导出geojson格式数据、修改样式、选中模式等功能

Downloads

14

Readme

安装

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
})