| | |
| | | <mobileGoTo></mobileGoTo> |
| | | <!-- 实景窗口 --> |
| | | <mobilePanorama></mobilePanorama> |
| | | <!-- 盖住左下角 --> |
| | | <div class="cover_mobileMap">智慧校园</div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | viewer.on(that.DC.SceneEventType.CAMERA_CHANGED, (e) => { |
| | | //相机移动最后参数 |
| | | //控制高度 |
| | | let isSet = that.dimension == "3D" ? false : true; |
| | | const height = Math.ceil(viewer.camera.positionCartographic.height); |
| | | let conBack = (height) => { |
| | | viewer.camera.setView({ |
| | |
| | | // if (height > 2000) { |
| | | // conBack(2000); |
| | | // } |
| | | if (height < 500) { |
| | | if (height < 500 && isSet) { |
| | | conBack(500); |
| | | } |
| | | if (height > 6000) { |
| | | if (height > 6000 && isSet) { |
| | | conBack(6000); |
| | | } |
| | | }); |
| | |
| | | //精细模型↓ |
| | | const tilesetLayer = new that.DC.TilesetLayer("tilesetLayer"); |
| | | viewer.addLayer(tilesetLayer); |
| | | const tileset = new that.DC.Tileset( |
| | | "http://data.mars3d.cn/3dtiles/max-shihua/tileset.json", |
| | | { |
| | | luminanceAtZenith: 0.5, |
| | | } |
| | | ); |
| | | const tileset = new that.DC.Tileset("/mx/tileset.json", { |
| | | luminanceAtZenith: 0.5, |
| | | }); |
| | | tilesetLayer.addOverlay(tileset); |
| | | // tilesetLayer.show = false; |
| | | |
| | |
| | | name: e.layer._bid, |
| | | address: e.layer.type, |
| | | introduce: e.layer._id, |
| | | data: e, |
| | | } |
| | | ); |
| | | //高亮 |
| | |
| | | tilesetLayer["changesilhouetteBlue"] = () => { |
| | | silhouetteBlue.selected = []; |
| | | }; |
| | | tilesetLayer.show = false; |
| | | // tilesetLayer.show = false; |
| | | //精细模型↑ |
| | | |
| | | // 2.5D贴图↓ |
| | |
| | | // new DC.Position(115.86798885, 28.72502592, 2100, 0, -45) |
| | | // ); |
| | | let doit = (int) => { |
| | | if (val == 1) { |
| | | if (int == "建模") { |
| | | viewer.flyTo(tileset); |
| | | } else if (val == 1) { |
| | | viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | |
| | | }; |
| | | that.dimension == "2.5D" |
| | | ? doit([116.36618337, 27.95911915, 2000.0]) |
| | | : doit([117.08513731, 31.64790556, 600.0]); |
| | | : // : doit([116.39038494750986, 39.902393222208644, 330.0]); |
| | | doit("建模"); |
| | | }; |
| | | startPoint(1); |
| | | // startPoint(1); |
| | | } |
| | | //传递默认位置 |
| | | that.$store.commit("MSET_MORENWEIZHI", startPoint); |
| | |
| | | viewer.zoomController.enable = true; |
| | | viewer.locationBar.enable = false; |
| | | viewer.distanceLegend.enable = false; |
| | | if (true) { |
| | | //判断默认维度 |
| | | //原本默认是2.5d 改为3d默认时做出改变 |
| | | if (that.dimension == "2.5D") { |
| | | that.$store.commit("MSET_DIMENSION", "2.5D"); //切换2.5D设置 |
| | | } else if (that.dimension == "3D") { |
| | | that.$store.commit("MSET_DIMENSION", "3D"); //切换3D设置 |
| | | } |
| | | if (false) { |
| | | //镜头改变示例 |
| | | // viewer.scene.screenSpaceCameraController.enableZoom = false; //控制视角缩放 |
| | | // viewer.scene.screenSpaceCameraController.enableTilt = false; //控制视角旋转 |
| | | // viewer.scene.screenSpaceCameraController.minimumZoomDistance = 200; //最小缩放 |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style lang='scss' scope> |
| | | <style lang="scss" scope> |
| | | #mobile-viewer-container { |
| | | width: 100%; |
| | | height: 100%; |