Skip to content

Commit

Permalink
docs(vue-cesium): 📝 updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyaoji committed Jul 29, 2023
1 parent f3679a7 commit ec17793
Show file tree
Hide file tree
Showing 47 changed files with 177 additions and 142 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Changelog

### 3.2.1

_2023-07-29_

#### Bug fixes

- Fixed the issue that the `vc-terrain-provider-cesium` component crashing in Cesium 1.107.
- Fixed the various compatibility issues with Cesium version 1.107.
- Fixed the issue that the mouse event of the `vc-primitive-cluster` component does not trigger.[#405](https://github.com/zouyaoji/vue-cesium/issues/405).

### 3.2.0

_2023-06-15_
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## 更新日志

### 3.2.1

_2023-07-29_

#### Bug 修复

- 修复 `vc-terrain-provider-cesium` 组件在Cesium 1.107版本崩溃的问题。
- 修复 Cesium 1.107 版本的各种不兼容问题。
- 修复 `vc-primitive-cluster` 组件鼠标事件不触发的问题。[#405](https://github.com/zouyaoji/vue-cesium/issues/405).

#### Bug 修复

### 3.2.0

_2023-06-15_
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/analyses/vc-analyses.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Basic usage of drawing components.
></vc-analyses>
<vc-primitive-tileset
url="https://zouyaoji.top/vue-cesium/SampleData/Cesium3DTiles/Tilesets/dayanta/tileset.json"
@ready-promise="onTilesetReady"
@ready="onTilesetReady"
></vc-primitive-tileset>
<vc-layer-imagery>
<vc-imagery-provider-tianditu map-style="img_c" :maximum-level="17" token="436ce7e50d27eede2f2929307e6b33c0"></vc-imagery-provider-tianditu>
Expand Down Expand Up @@ -79,7 +79,7 @@ Basic usage of drawing components.
toggle(drawingActionInstance) {
this.$refs.drawingsCustomRef.toggleAction(drawingActionInstance.name)
},
onTilesetReady(tileset, viewer) {
onTilesetReady({ cesiumObject: tileset, viewer }) {
// const cartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center)
// const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height)
// const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 5)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/analyses/vc-drawings.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Basic usage of drawing components.
</vc-drawings>
<vc-primitive-tileset
url="https://zouyaoji.top/vue-cesium/SampleData/Cesium3DTiles/Tilesets/dayanta/tileset.json"
@ready-promise="onTilesetReady"
@ready="onTilesetReady"
></vc-primitive-tileset>
<vc-layer-imagery>
<vc-imagery-provider-arcgis></vc-imagery-provider-arcgis>
Expand Down Expand Up @@ -156,7 +156,7 @@ Basic usage of drawing components.
toggle(drawingActionInstance) {
this.$refs.drawingsCustomRef.toggleAction(drawingActionInstance.name)
},
onTilesetReady(tileset, viewer) {
onTilesetReady({ cesiumObject: tileset, viewer }) {
const cartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center)
const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height)
const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 5)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/analyses/vc-measurements.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Basic usage of measurement components.
</vc-measurements>
<vc-primitive-tileset
url="https://zouyaoji.top/vue-cesium/SampleData/Cesium3DTiles/Tilesets/dayanta/tileset.json"
@ready-promise="onTilesetReady"
@ready="onTilesetReady"
></vc-primitive-tileset>
<vc-layer-imagery>
<vc-imagery-provider-osm></vc-imagery-provider-osm>
Expand Down Expand Up @@ -190,7 +190,7 @@ Basic usage of measurement components.
toggle(drawingActionInstance) {
this.$refs.measurementsRef4.toggleAction(drawingActionInstance.name)
},
onTilesetReady(tileset, viewer) {
onTilesetReady({ cesiumObject: tileset, viewer }) {
// const cartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center)
// const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height)
// const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 5)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/en-US/geometries/vc-geometry-box.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Basic usage of VcGeometryBox component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
geometries[0].viewer.scene.camera.flyToBoundingSphere(boundingSphereUnion)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-circle.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Basic usage of VcGeometryCircle component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-corridor.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ Basic usage of VcGeometryCorridor component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-cylinder.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ Basic usage of VcGeometryCylinder component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-ellipse.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Basic usage of VcGeometryEllipse component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-ellipsoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ The basic usage of VcGeometryEllipsoid component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-frustum.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ Basic usage of the VcGeometryFrustum component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
29 changes: 14 additions & 15 deletions website/docs/en-US/geometries/vc-geometry-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ Basic usage of geometry instance components.
const boundingSphereUnion = instances.reduce((prev, cur) => {
const geometry = cur.cesiumObject.geometry || cur.cesiumObject
const computGeometry = geometry.constructor.createGeometry(geometry)
const boundingSphere =
cur.cesiumObject.modelMatrix || cur.vm.$parent.modelMatrix
? BoundingSphere.transform(computGeometry.boundingSphere, cur.cesiumObject.modelMatrix || cur.vm.$parent.modelMatrix)
: computGeometry.boundingSphere
const boundingSphere = cur.cesiumObject.geometry
? BoundingSphere.transform(computGeometry.boundingSphere, cur.cesiumObject.modelMatrix || cur.vm.proxy.$parent.modelMatrix)
: computGeometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
instances[0].viewer.scene.camera.flyToBoundingSphere(boundingSphereUnion)
Expand Down Expand Up @@ -158,12 +157,12 @@ Basic usage of geometry instance components.

### Props

| Name | Type | Default | Description |
| ----------- | ------ | ------- | ------------------------------------------------------------------------------------------------------ |
| Name | Type | Default | Description |
| ----------- | ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| geometry | Cesium.Geometry \| Cesium.GeometryFactory | | `optional` The geometry to instance. |
| modelMatrix | Cesium.Matrix4 | | `optional` The model matrix that transforms to transform the geometry from model to world coordinates. |
| id | any | | `optional` A user-defined object to return when the instance is picked with `Scene#pick`. |
| attributes | any | | `optional` Per-instance attributes like a show or color attribute shown in the example below. |
| modelMatrix | Cesium.Matrix4 | | `optional` The model matrix that transforms to transform the geometry from model to world coordinates. |
| id | any | | `optional` A user-defined object to return when the instance is picked with `Scene#pick`. |
| attributes | any | | `optional` Per-instance attributes like a show or color attribute shown in the example below. |

### Events

Expand All @@ -175,13 +174,13 @@ Basic usage of geometry instance components.

### Methods

| Name | Parameters | Description |
| ------------------ | --------------------------------------- | ----------------------------------------------- |
| load | () => Promise\<false \| VcReadyObject\> | Load components manually. |
| reload | () => Promise\<false \| VcReadyObject\> | Reload components manually. |
| unload | () => Promise\<boolean\> | Destroy the loaded component manually. |
| Name | Parameters | Description |
| ------------------ | ---------------------------------------- | ----------------------------------------------- |
| load | () => Promise\<false \| VcReadyObject\> | Load components manually. |
| reload | () => Promise\<false \| VcReadyObject\> | Reload components manually. |
| unload | () => Promise\<boolean\> | Destroy the loaded component manually. |
| getCreatingPromise | () => Promise\<boolean \| VcReadyObject> | Get the creatingPromise. |
| getCesiumObject | () => VcCesiumObject | Get the Cesium object loaded by this component. |
| getCesiumObject | () => VcCesiumObject | Get the Cesium object loaded by this component. |

### Slots

Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Basic usage of VcGeometryPlane component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-polygon-coplanar.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ Basic usage of VcGeometryPolygonCoplanar component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-polygon.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ Basic usage of VcGeometryPolygon component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-polyline-volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ The basic usage of the VcGeometryPolylineVolume component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-rectangle.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ Basic usage of VcGeometryRectangle component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-sphere.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ The basic usage of VcGeometrySphere component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/geometries/vc-geometry-wall.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ Basic usage of VcGeometryWall component.
const { BoundingSphere } = Cesium
const boundingSphereUnion = geometries.reduce((prev, cur) => {
const geometry = cur.cesiumObject.constructor.createGeometry(cur.cesiumObject)
const boundingSphere = cur.vm.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.$parent.modelMatrix)
const boundingSphere = cur.vm.proxy.$parent.modelMatrix
? BoundingSphere.transform(geometry.boundingSphere, cur.vm.proxy.$parent.modelMatrix)
: geometry.boundingSphere
return prev === null ? boundingSphere : BoundingSphere.union(prev, boundingSphere)
}, null)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en-US/primitives/vc-collection-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Basic usage of VcCollectionCloud component.
const load = () => {
cloudCollectionRef.value.load()
}
const onViewerReady = ({ Cesium, viewer }) => {
const onViewerReady = async ({ Cesium, viewer }) => {
const scene = viewer.scene
scene.primitives.add(Cesium.createOsmBuildings())
scene.primitives.add(await Cesium.createOsmBuildingsAsync())
// clouds.value.push({
// position: [-122.6908, 45.496, 300],
// scale: [1500, 250],
Expand Down
2 changes: 1 addition & 1 deletion website/docs/en-US/primitives/vc-primitive-particle.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Basic usage of VcPrimitiveParticle component.
var maxLife = 1.0
var life = normalSize * (maxLife - minLife) + minLife
return {
color: {},
color,
image: this.getImage(),
startColor: color,
endColor: color.withAlpha(0.0),
Expand Down
Loading

0 comments on commit ec17793

Please sign in to comment.