Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyaoji committed Oct 23, 2023
2 parents 432ebff + 35742d3 commit a324984
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _2023-10-23_

- Fixed the issue that the `vc-imagery-provider-supermap` component causing errors with the SuperMap platform.
- Resolved the discrepancy between the props passed to the `vc-primitive-tileset` component and the official documentation.
- Fixed the issue that the `vc-collection-primitive` component not forwarding newly added events.

### 3.2.2

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _2023-10-23_

- `vc-imagery-provider-supermap` 组件在引入超图平台报错的问题。
- `vc-primitive-tileset` 组件传参与官方文档不一致的问题。
- `vc-collection-primitive` 组件未转发官方新增事件的问题。

### 3.2.2

Expand Down
3 changes: 3 additions & 0 deletions packages/composables/use-primitive-collections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export type Collection =

export default function (props, ctx, vcInstance: VcComponentInternalInstance) {
// state

vcInstance.cesiumEvents = ['primitiveAdded', 'primitiveRemoved']

const commonState = useCommon(props, ctx, vcInstance)
if (commonState === void 0) {
return
Expand Down
3 changes: 2 additions & 1 deletion website/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export default defineComponent({
VcConfigProvider,
{
locale: localeMap[this.lang],
cesiumPath: './Cesium/Cesium.js',
cesiumPath:
process.env.NODE_ENV === 'development' ? './CesiumUnminified/Cesium.js' : 'https://unpkg.com/cesium@latest/Build/Cesium/Cesium.js',
accessToken:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNzkyNWNlYi0xMzgxLTQwOTYtOTRhYS02ZTM4YjYwYWVjMzYiLCJpZCI6Njk5Nywic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0ODAzNDEyMn0.0MtHA4jjYQAtYyKjnKnzNziwkSmtLq8qiQqqPtiAfnA'
},
Expand Down
29 changes: 16 additions & 13 deletions website/docs/en-US/primitives/vc-collection-primitive.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,22 @@ Basic usage of VcCollectionPrimitive component.

### Events

| Name | Parameters | Description |
| ---------- | --------------------------------------- | ---------------------------------------------------------------- |
| beforeLoad | (instance: VcComponentInternalInstance) | Triggers before the cesiumObject is loaded. |
| ready | (readyObj: VcReadyObject) | Triggers when the cesiumObject is successfully loaded. |
| destroyed | (instance: VcComponentInternalInstance) | Triggers when the cesiumObject is destroyed. |
| mousedown | (evt: VcPickEvent) | Triggers when the mouse is pressed on this primitive. |
| mouseup | (evt: VcPickEvent) | Triggers when the mouse bounces up on this primitive. |
| click | (evt: VcPickEvent) | Triggers when the mouse clicks on the primitive. |
| clickout | (evt: VcPickEvent) | Triggers when the mouse clicks outside the primitive. |
| dblclick | (evt: VcPickEvent) | Triggers when the left mouse button double-clicks the primitive. |
| mousemove | (evt: VcPickEvent) | Triggers when the mouse moves on this primitive. |
| mouseover | (evt: VcPickEvent) | Triggers when the mouse moves to this primitive. |
| mouseout | (evt: VcPickEvent) | Triggers when the mouse moves out of this primitive. |
<!-- prettier-ignore -->
| Name | Parameters | Description |
| ---------------- | ------------------------------------------- | ---------------------------------------------------------------- |
| primitiveAdded | (evt: VcPrimitive \| VcPrimitiveCollection) | Triggers when a primitive is added to the collection. [VueCesium3.23+;Cesium 1.110+] |
| primitiveRemoved | (evt: VcPrimitive \| VcPrimitiveCollection) | Triggers when a primitive is removed from the collection. [VueCesium3.23+;Cesium 1.110+] |
| beforeLoad | (instance: VcComponentInternalInstance) | Triggers before the cesiumObject is loaded. |
| ready | (readyObj: VcReadyObject) | Triggers when the cesiumObject is successfully loaded. |
| destroyed | (instance: VcComponentInternalInstance) | Triggers when the cesiumObject is destroyed. |
| mousedown | (evt: VcPickEvent) | Triggers when the mouse is pressed on this primitive. |
| mouseup | (evt: VcPickEvent) | Triggers when the mouse bounces up on this primitive. |
| click | (evt: VcPickEvent) | Triggers when the mouse clicks on the primitive. |
| clickout | (evt: VcPickEvent) | Triggers when the mouse clicks outside the primitive. |
| dblclick | (evt: VcPickEvent) | Triggers when the left mouse button double-clicks the primitive. |
| mousemove | (evt: VcPickEvent) | Triggers when the mouse moves on this primitive. |
| mouseover | (evt: VcPickEvent) | Triggers when the mouse moves to this primitive. |
| mouseout | (evt: VcPickEvent) | Triggers when the mouse moves out of this primitive. |

### Slots

Expand Down
41 changes: 24 additions & 17 deletions website/docs/zh-CN/primitives/vc-collection-primitive.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<el-row ref="viewerContainer" class="demo-viewer">
<vc-viewer @ready="onViewerReady">
<vc-selection-indicator ref="selectionIndicator" @pickEvt="pickEvt"></vc-selection-indicator>
<vc-collection-primitive @click="onClicked" :show="show" ref="collectionRef">
<vc-collection-primitive @click="onClicked" :show="show" ref="collectionRef" @primitive-added="primitiveAdded">
<vc-collection-billboard :billboards="billboards1"></vc-collection-billboard>
<vc-collection-primitive>
<vc-collection-billboard :billboards="billboards2"></vc-collection-billboard>
</vc-collection-primitive>
</vc-collection-primitive>
<vc-collection-primitive @click="onClicked" :polygons="polygons">
<!-- <vc-collection-primitive @click="onClicked" :polygons="polygons">
<vc-primitive-model
@click="onClicked"
url="https://zouyaoji.top/vue-cesium/SampleData/models/CesiumAir/Cesium_Air.glb"
Expand All @@ -33,7 +33,7 @@
>
</vc-primitive-model>
<vc-polygon @click="onClicked" :positions="positions" color="yellow"></vc-polygon>
</vc-collection-primitive>
</vc-collection-primitive> -->
</vc-viewer>
<el-row class="demo-toolbar">
<el-button type="danger" round @click="unload">销毁</el-button>
Expand Down Expand Up @@ -170,6 +170,7 @@
billboard1.image = 'https://zouyaoji.top/vue-cesium/favicon.png'
billboard1.scale = 0.1
billboards1.value.push(billboard1)
window.billboards1 = billboards1
let billboard2 = {}
billboard2.position = { lng: Math.random() * 40 + 85, lat: Math.random() * 30 + 21 }
Expand All @@ -183,6 +184,9 @@
const pickEvt = e => {
console.log(e)
}
const primitiveAdded = (a, b) => {
console.log('primitiveAdded', a, b)
}
return {
pickEvt,
unload,
Expand All @@ -196,7 +200,8 @@
modelMatrix,
show,
positions,
polygons
polygons,
primitiveAdded
}
}
}
Expand All @@ -216,19 +221,21 @@

### 事件

| 事件名 | 参数 | 描述 |
| ---------- | --------------------------------------- | -------------------------- |
| beforeLoad | (instance: VcComponentInternalInstance) | 对象加载前触发。 |
| ready | (readyObj: VcReadyObject) | 对象加载成功时触发。 |
| destroyed | (instance: VcComponentInternalInstance) | 对象销毁时触发。 |
| mousedown | (evt: VcPickEvent) | 鼠标在该图元上按下时触发。 |
| mouseup | (evt: VcPickEvent) | 鼠标在该图元上弹起时触发。 |
| click | (evt: VcPickEvent) | 鼠标单击该图元时触发。 |
| clickout | (evt: VcPickEvent) | 鼠标单击该图元外部时触发。 |
| dblclick | (evt: VcPickEvent) | 鼠标左键双击该图元时触发。 |
| mousemove | (evt: VcPickEvent) | 鼠标在该图元上移动时触发。 |
| mouseover | (evt: VcPickEvent) | 鼠标移动到该图元时触发。 |
| mouseout | (evt: VcPickEvent) | 鼠标移出该图元时触发。 |
| 事件名 | 参数 | 描述 |
| ---------------- | ------------------------------------------- | ---------------------------------------------- |
| primitiveAdded | (evt: VcPrimitive \| VcPrimitiveCollection) | 图元添加时触发。[VueCesium3.23+;Cesium 1.110+] |
| primitiveRemoved | (evt: VcPrimitive \| VcPrimitiveCollection) | 图元移除时触发。[VueCesium3.23+;Cesium 1.110+] |
| beforeLoad | (instance: VcComponentInternalInstance) | 对象加载前触发。 |
| ready | (readyObj: VcReadyObject) | 对象加载成功时触发。 |
| destroyed | (instance: VcComponentInternalInstance) | 对象销毁时触发。 |
| mousedown | (evt: VcPickEvent) | 鼠标在该图元上按下时触发。 |
| mouseup | (evt: VcPickEvent) | 鼠标在该图元上弹起时触发。 |
| click | (evt: VcPickEvent) | 鼠标单击该图元时触发。 |
| clickout | (evt: VcPickEvent) | 鼠标单击该图元外部时触发。 |
| dblclick | (evt: VcPickEvent) | 鼠标左键双击该图元时触发。 |
| mousemove | (evt: VcPickEvent) | 鼠标在该图元上移动时触发。 |
| mouseover | (evt: VcPickEvent) | 鼠标移动到该图元时触发。 |
| mouseout | (evt: VcPickEvent) | 鼠标移出该图元时触发。 |

### 插槽

Expand Down

0 comments on commit a324984

Please sign in to comment.