Skip to content

Commit a324984

Browse files
committed
Merge branch 'dev'
2 parents 432ebff + 35742d3 commit a324984

File tree

6 files changed

+47
-31
lines changed

6 files changed

+47
-31
lines changed

CHANGELOG.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _2023-10-23_
88

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

1213
### 3.2.2
1314

CHANGELOG.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _2023-10-23_
88

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

1213
### 3.2.2
1314

packages/composables/use-primitive-collections/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export type Collection =
3030

3131
export default function (props, ctx, vcInstance: VcComponentInternalInstance) {
3232
// state
33+
34+
vcInstance.cesiumEvents = ['primitiveAdded', 'primitiveRemoved']
35+
3336
const commonState = useCommon(props, ctx, vcInstance)
3437
if (commonState === void 0) {
3538
return

website/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export default defineComponent({
9393
VcConfigProvider,
9494
{
9595
locale: localeMap[this.lang],
96-
cesiumPath: './Cesium/Cesium.js',
96+
cesiumPath:
97+
process.env.NODE_ENV === 'development' ? './CesiumUnminified/Cesium.js' : 'https://unpkg.com/cesium@latest/Build/Cesium/Cesium.js',
9798
accessToken:
9899
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNzkyNWNlYi0xMzgxLTQwOTYtOTRhYS02ZTM4YjYwYWVjMzYiLCJpZCI6Njk5Nywic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0ODAzNDEyMn0.0MtHA4jjYQAtYyKjnKnzNziwkSmtLq8qiQqqPtiAfnA'
99100
},

website/docs/en-US/primitives/vc-collection-primitive.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,22 @@ Basic usage of VcCollectionPrimitive component.
213213

214214
### Events
215215

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

230233
### Slots
231234

website/docs/zh-CN/primitives/vc-collection-primitive.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<el-row ref="viewerContainer" class="demo-viewer">
1717
<vc-viewer @ready="onViewerReady">
1818
<vc-selection-indicator ref="selectionIndicator" @pickEvt="pickEvt"></vc-selection-indicator>
19-
<vc-collection-primitive @click="onClicked" :show="show" ref="collectionRef">
19+
<vc-collection-primitive @click="onClicked" :show="show" ref="collectionRef" @primitive-added="primitiveAdded">
2020
<vc-collection-billboard :billboards="billboards1"></vc-collection-billboard>
2121
<vc-collection-primitive>
2222
<vc-collection-billboard :billboards="billboards2"></vc-collection-billboard>
2323
</vc-collection-primitive>
2424
</vc-collection-primitive>
25-
<vc-collection-primitive @click="onClicked" :polygons="polygons">
25+
<!-- <vc-collection-primitive @click="onClicked" :polygons="polygons">
2626
<vc-primitive-model
2727
@click="onClicked"
2828
url="https://zouyaoji.top/vue-cesium/SampleData/models/CesiumAir/Cesium_Air.glb"
@@ -33,7 +33,7 @@
3333
>
3434
</vc-primitive-model>
3535
<vc-polygon @click="onClicked" :positions="positions" color="yellow"></vc-polygon>
36-
</vc-collection-primitive>
36+
</vc-collection-primitive> -->
3737
</vc-viewer>
3838
<el-row class="demo-toolbar">
3939
<el-button type="danger" round @click="unload">销毁</el-button>
@@ -170,6 +170,7 @@
170170
billboard1.image = 'https://zouyaoji.top/vue-cesium/favicon.png'
171171
billboard1.scale = 0.1
172172
billboards1.value.push(billboard1)
173+
window.billboards1 = billboards1
173174
174175
let billboard2 = {}
175176
billboard2.position = { lng: Math.random() * 40 + 85, lat: Math.random() * 30 + 21 }
@@ -183,6 +184,9 @@
183184
const pickEvt = e => {
184185
console.log(e)
185186
}
187+
const primitiveAdded = (a, b) => {
188+
console.log('primitiveAdded', a, b)
189+
}
186190
return {
187191
pickEvt,
188192
unload,
@@ -196,7 +200,8 @@
196200
modelMatrix,
197201
show,
198202
positions,
199-
polygons
203+
polygons,
204+
primitiveAdded
200205
}
201206
}
202207
}
@@ -216,19 +221,21 @@
216221

217222
### 事件
218223

219-
| 事件名 | 参数 | 描述 |
220-
| ---------- | --------------------------------------- | -------------------------- |
221-
| beforeLoad | (instance: VcComponentInternalInstance) | 对象加载前触发。 |
222-
| ready | (readyObj: VcReadyObject) | 对象加载成功时触发。 |
223-
| destroyed | (instance: VcComponentInternalInstance) | 对象销毁时触发。 |
224-
| mousedown | (evt: VcPickEvent) | 鼠标在该图元上按下时触发。 |
225-
| mouseup | (evt: VcPickEvent) | 鼠标在该图元上弹起时触发。 |
226-
| click | (evt: VcPickEvent) | 鼠标单击该图元时触发。 |
227-
| clickout | (evt: VcPickEvent) | 鼠标单击该图元外部时触发。 |
228-
| dblclick | (evt: VcPickEvent) | 鼠标左键双击该图元时触发。 |
229-
| mousemove | (evt: VcPickEvent) | 鼠标在该图元上移动时触发。 |
230-
| mouseover | (evt: VcPickEvent) | 鼠标移动到该图元时触发。 |
231-
| mouseout | (evt: VcPickEvent) | 鼠标移出该图元时触发。 |
224+
| 事件名 | 参数 | 描述 |
225+
| ---------------- | ------------------------------------------- | ---------------------------------------------- |
226+
| primitiveAdded | (evt: VcPrimitive \| VcPrimitiveCollection) | 图元添加时触发。[VueCesium3.23+;Cesium 1.110+] |
227+
| primitiveRemoved | (evt: VcPrimitive \| VcPrimitiveCollection) | 图元移除时触发。[VueCesium3.23+;Cesium 1.110+] |
228+
| beforeLoad | (instance: VcComponentInternalInstance) | 对象加载前触发。 |
229+
| ready | (readyObj: VcReadyObject) | 对象加载成功时触发。 |
230+
| destroyed | (instance: VcComponentInternalInstance) | 对象销毁时触发。 |
231+
| mousedown | (evt: VcPickEvent) | 鼠标在该图元上按下时触发。 |
232+
| mouseup | (evt: VcPickEvent) | 鼠标在该图元上弹起时触发。 |
233+
| click | (evt: VcPickEvent) | 鼠标单击该图元时触发。 |
234+
| clickout | (evt: VcPickEvent) | 鼠标单击该图元外部时触发。 |
235+
| dblclick | (evt: VcPickEvent) | 鼠标左键双击该图元时触发。 |
236+
| mousemove | (evt: VcPickEvent) | 鼠标在该图元上移动时触发。 |
237+
| mouseover | (evt: VcPickEvent) | 鼠标移动到该图元时触发。 |
238+
| mouseout | (evt: VcPickEvent) | 鼠标移出该图元时触发。 |
232239

233240
### 插槽
234241

0 commit comments

Comments
 (0)