| | |
| | | if (this.$store.state.previewLayer) { |
| | | var res = this.$store.state.previewLayer; |
| | | var type = res.type; |
| | | if (res.url.indexOf('.png') != -1) { |
| | | if (type == 'DEM') { |
| | | window.terrainLayer.deleteObject(); |
| | | window.terrainLayer = null; |
| | | window.terrainLayer = new Cesium.CesiumTerrainProvider({ |
| | | url: res.url |
| | | }); |
| | | Viewer.terrainProvider = window.terrainLayer |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(113.229279, 31.215949, 1000), |
| | | orientation: { |
| | | heading: 6.08434611923462, |
| | | pitch: Cesium.Math.toRadians(-45.0), |
| | | roll: 0.0 |
| | | } |
| | | }); |
| | | |
| | | } else if (res.url.indexOf('.png') != -1) { |
| | | var wkt = this.$wkt.parse(res.geom); |
| | | var height = this.getHeight(wkt.coordinates[2]) |
| | | window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( |
| | |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], height), |
| | | }); |
| | | } else if (res.url.indexOf('.json') != -1) { |
| | | } else if (type == '3dml') { |
| | | if (this.app.tileset) viewer.scene.primitives.remove(this.app.tileset); |
| | | this.app.tileset = this.createTileset(res); |
| | | var that = this; |