|
@@ -171,15 +171,7 @@ export default {
|
|
|
if (this.gisList.children.length > 0) {
|
|
|
window.api.Public.setGisState(true)
|
|
|
}
|
|
|
- //设置gis地图
|
|
|
- window.api.Public.AddImageryProvider(
|
|
|
- 'https://mapapi.geodata.gov.hk/gs/api/v1.0.0/xyz/imagery/WGS84/{z}/{x}/{y}.png',
|
|
|
- true,
|
|
|
- {
|
|
|
- serverType: 0,
|
|
|
- maximumLevel: 19,
|
|
|
- }
|
|
|
- )
|
|
|
+ this.loadHKMap()
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|
|
@@ -459,16 +451,13 @@ export default {
|
|
|
this.cadList.children[modelindex] = detail
|
|
|
}
|
|
|
}
|
|
|
- this.treeData[0].children = [...this.treeData[0].children ]
|
|
|
+ this.treeData[0].children = [...this.treeData[0].children]
|
|
|
this.$message.success(this.$t('save.ok'))
|
|
|
},
|
|
|
resetModel(detail) {
|
|
|
- window.api.Model.setModelMatrix(
|
|
|
- detail.lightweightName,
|
|
|
- window.Cesium.Matrix4.IDENTITY
|
|
|
- );
|
|
|
- window.api.viewer.scene.requestRender();
|
|
|
- window.api.Model.location(detail.lightweightName);
|
|
|
+ window.api.Model.setModelMatrix(detail.lightweightName, window.Cesium.Matrix4.IDENTITY)
|
|
|
+ window.api.viewer.scene.requestRender()
|
|
|
+ window.api.Model.location(detail.lightweightName)
|
|
|
this.initOffset(detail)
|
|
|
this.initRotate(detail)
|
|
|
},
|
|
@@ -495,7 +484,31 @@ export default {
|
|
|
options.point2 = point2Z
|
|
|
options.rotate = modelInfo.rotate.z
|
|
|
window.api.Model.rotateByAnyAxis(options)
|
|
|
- }
|
|
|
+ },
|
|
|
+ loadHKMap() {
|
|
|
+ //设置gis地图
|
|
|
+ window.api.Public.AddImageryProvider(
|
|
|
+ 'https://mapapi.geodata.gov.hk/gs/api/v1.0.0/xyz/imagery/WGS84/{z}/{x}/{y}.png',
|
|
|
+ true,
|
|
|
+ {
|
|
|
+ serverType: 0,
|
|
|
+ maximumLevel: 19,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ //加载建筑模型
|
|
|
+ window.api.Model.mergeModel(
|
|
|
+ 'https://data1.map.gov.hk/api/3d-data/3dtiles/f2/tileset.json?key=3967f8f365694e0798af3e7678509421',
|
|
|
+ 'hkBuilding',
|
|
|
+ (res) => {
|
|
|
+ console.log('模型开始加载 回调')
|
|
|
+ },
|
|
|
+ (res) => {},
|
|
|
+ {
|
|
|
+ flyto: true,
|
|
|
+ maxspaceerror: 0.3,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|