English | 简体中文
Plugins for improving the availability of Cesium.
Using npm:
npm i cesium-plugins
import { PositionPicker } from 'cesium-plugins'
For quick sketches, you can import cesium-plugins
directly from jsDelivr CDN.
<script type="module">
import { PositionPicker } from 'https://cdn.jsdelivr.net/npm/cesium-plugins@1.0.63/index.js'
</script>
The library is also available in UMD format under the namespace CP
.
<script src="https://cdn.jsdelivr.net/npm/cesium-plugins@1.0.63/index.umd.js"></script>
<script>
const picker = new CP.PositionPicker(Cesium, viewer)
</script>
-
PositionPicker:Plugin for left mouse click to pick up longitude, latitude, and height.
-
Cesium3DTilesLoader:Plugin for loading and configuring 3DTiles.
-
Tooltip:Plugin for creating tooltip that follow mouse movement.
-
exportSceneAsImage:Function used to export the scene as an image.
-
FloodAnalysis:Plugin for simulating flood analysis.
-
RotateAroundPoint:Plugin for camera rotation around a point.
-
WaterMask:Plugin for generating dynamic water surface.
-
HTMLOverlay:Plugin for placing an HTML element on top of the Cesium canvas.
Make sure that Cesium
has been set up and that the viewer
has been initialized.
The following uses PositionPicker
as an example to describe the basic usage of cesium-plugins
.
import { PositionPicker } from 'cesium-plugins'
const picker = new PositionPicker(Cesium, viewer)
picker.pick(({ lon, lat, hgt }) => {
console.log(lon, lat, hgt)
}, true)