| | |
| | | <div> |
| | | <div id="sdkContainer"></div> |
| | | |
| | | |
| | | <div class="listBox" v-show="viewer1Show && !isLand"> |
| | | <ul id="viewer_lsyx"> |
| | | <li |
| | | v-for="(item, index) in arr" |
| | | :key="index" |
| | | @click="changeLeftMap($event, item, index)" |
| | | > |
| | | {{ item }} |
| | | </li> |
| | | >{{ item }}</li> |
| | | </ul> |
| | | </div> |
| | | |
| | |
| | | <switchImagerLayer ref="switchImagerLayer" v-show="switchImagerLayer" /> |
| | | </transition> |
| | | |
| | | <img |
| | | class="swichImg" |
| | | @click="switchImagerLayerShowOrHide" |
| | | :src="switchImage" |
| | | /> |
| | | <img class="swichImg" @click="switchImagerLayerShowOrHide" :src="switchImage" /> |
| | | <div class="bgbox"> |
| | | <img |
| | | class="swichImg" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import common from "@/components/common"; |
| | | import layerTreeTwoScreen from "@/components/left/layerTreeTwoScreen"; |
| | | import switchImagerLayer from "@/components/right/switchImagerLayer"; |
| | | import { mapState, mapMutations } from "vuex"; |
| | |
| | | import jiejing from "@/assets/img/new/jiejing.png"; |
| | | import "animate.css"; |
| | | import Bus from "@tools/Bus"; |
| | | |
| | | import mapData from "../../../static/mapData"; |
| | | import mapMsg from "../../assets/js/mapMsg"; |
| | | import vueEvents from "@/utils/vueEvent.js"; |
| | | |
| | | let activeLi, nLayer, LWLayer; |
| | | export default { |
| | | name: "viewer", |
| | | components: { |
| | | switchImagerLayer, |
| | | layerTreeTwoScreen, |
| | | layerTreeTwoScreen |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | offset: "0%", |
| | | radio: 3, |
| | | arr: [ |
| | | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, |
| | | 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, |
| | | ], |
| | | 2001, |
| | | 2002, |
| | | 2003, |
| | | 2004, |
| | | 2005, |
| | | 2006, |
| | | 2007, |
| | | 2008, |
| | | 2009, |
| | | 2010, |
| | | 2011, |
| | | 2012, |
| | | 2013, |
| | | 2014, |
| | | 2015, |
| | | 2016, |
| | | 2017, |
| | | 2018, |
| | | 2019, |
| | | 2020, |
| | | 2021 |
| | | ] |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["viewer1Show", "isLand", "layerTreeTwoScreen", "cesiumInit"]), |
| | | |
| | | ...mapState(["viewer1Show", "isLand", "layerTreeTwoScreen", "cesiumInit"]) |
| | | }, |
| | | watch: { |
| | | viewer1Show(newvalue, oldvalue) { |
| | |
| | | } else { |
| | | this.initLSYX(); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | let pathName = window.location.pathname.split("/"); |
| | |
| | | } |
| | | this.$nextTick(function () { |
| | | let that = this; |
| | | //*********北京sdk************ |
| | | window.sgworld = new SmartEarth.EarthCtrl( |
| | | "sdkContainer", |
| | | { |
| | | StaticFileBaseUrl: StaticFileBaseUrl, |
| | | StaticFileBaseUrl: StaticFileBaseUrl |
| | | }, |
| | | {}, |
| | | {}, |
| | |
| | | 39.744945, |
| | | 50000 |
| | | ), |
| | | duration: 7, //飞行时间8s |
| | | duration: 7 //飞行时间8s |
| | | }); |
| | | //再飞到朝林大厦 |
| | | setTimeout(() => { |
| | |
| | | 39.791361, |
| | | 5000 |
| | | ), |
| | | duration: 5, //飞行时间8s |
| | | duration: 5 //飞行时间8s |
| | | }); |
| | | }, 8000); |
| | | setTimeout(() => { |
| | |
| | | orientation: { |
| | | heading: Cesium.Math.toRadians(328.5), |
| | | pitch: Cesium.Math.toRadians(-27.5), |
| | | roll: Cesium.Math.toRadians(0.0), |
| | | roll: Cesium.Math.toRadians(0.0) |
| | | }, |
| | | duration: 5, //飞行时间8s |
| | | duration: 5 //飞行时间8s |
| | | }); |
| | | // console.log("加载完成"); |
| | | }, 14000); |
| | |
| | | editProp: true, |
| | | editPropData: { |
| | | offset: "r", |
| | | height: "60%", |
| | | height: "60%" |
| | | }, |
| | | callBack: { |
| | | delete: function (entity) { |
| | |
| | | let style = sgworld.Creator.SimpleGraphic.getStyle(entity); |
| | | let data = { |
| | | name: entity.name, |
| | | style: style, |
| | | style: style |
| | | }; |
| | | Bus.$emit("updataTreeNode", entity.id, data); |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }); |
| | | //标会编辑 |
| | | // sgworld.Creator.SimpleGraphic.setEdit(true, { |
| | |
| | | if (layeroHeight >= titleHeight + htmlHeight) { |
| | | layero.height(titleHeight + htmlHeight); |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //初始化弹窗事件 |
| | |
| | | let tilingScheme = new Cesium.GeographicTilingScheme({ |
| | | rectangle: rectangle, |
| | | numberOfLevelZeroTilesX: 2, |
| | | numberOfLevelZeroTilesY: 1, |
| | | numberOfLevelZeroTilesY: 1 |
| | | }); |
| | | var dx = { |
| | | url: paramUrl, |
| | |
| | | }, |
| | | ny: function (imageryProvider, x, y, level) { |
| | | return (2 << (level - 1)) + y; |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | var imageryProvider = new Cesium.UrlTemplateImageryProvider(dx); |
| | | let imageLayer = new Cesium.ImageryLayer(imageryProvider, { |
| | | alpha: 1, |
| | | brightness: 1.0, |
| | | brightness: 1.0 |
| | | }); |
| | | Viewer.imageryLayers.add(imageLayer, 3); |
| | | return imageLayer; |
| | |
| | | let tilingScheme = new Cesium.GeographicTilingScheme({ |
| | | rectangle: rectangle, |
| | | numberOfLevelZeroTilesX: 2, |
| | | numberOfLevelZeroTilesY: 1, |
| | | numberOfLevelZeroTilesY: 1 |
| | | }); |
| | | var dx = { |
| | | url: paramUrl, |
| | |
| | | }, |
| | | ny: function (imageryProvider, x, y, level) { |
| | | return (2 << (level - 1)) + y; |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | var imageryProvider = new Cesium.UrlTemplateImageryProvider(dx); |
| | | let imageLayer = new Cesium.ImageryLayer(imageryProvider, { |
| | | alpha: 1, |
| | | brightness: 1.0, |
| | | brightness: 1.0 |
| | | }); |
| | | Viewer.imageryLayers.add(imageLayer, 2); |
| | | return imageLayer; |
| | |
| | | this.switchImagerLayer = !this.switchImagerLayer; |
| | | }, |
| | | ArcgisImageryLayer() { |
| | | sgworld.Creator.createArcGisImageryLayer( |
| | | let InitMap = sgworld.Creator.createArcGisImageryLayer( |
| | | "ARCGIS", |
| | | { |
| | | url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", |
| | | enablePickFeatures: false, |
| | | url: |
| | | "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", |
| | | enablePickFeatures: false |
| | | }, |
| | | "0", |
| | | 1, |
| | | true, |
| | | "" |
| | | ); |
| | | console.log(InitMap); |
| | | }, |
| | | //初始化弹窗事件 |
| | | |
| | |
| | | offset: options.offset || undefined, |
| | | area: [ |
| | | typeof width === "number" ? width + "px" : width, |
| | | typeof height === "number" ? height + "px" : height, |
| | | typeof height === "number" ? height + "px" : height |
| | | ], |
| | | content: options.url, |
| | | success: function (layero, index) { |
| | | layero.css({ |
| | | "border-radius": "8px", |
| | | "border-radius": "8px" |
| | | }); |
| | | if (successFn && typeof successFn === "function") { |
| | | successFn(layero, index); |
| | |
| | | if (endFn && typeof endFn === "function") { |
| | | endFn(); |
| | | } |
| | | }, |
| | | } |
| | | }); |
| | | }; |
| | | }, |
| | |
| | | "<div style='color: #FFFFFF;float: left;height: 28px;line-height: 28px;'></div>"; |
| | | |
| | | let handler3D = new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas); |
| | | handler3D.setInputAction((wheelment) => { |
| | | handler3D.setInputAction(wheelment => { |
| | | // 滚动滚轴,得到当前的视点高度 |
| | | // 单位换算,当大于1000米的时候显示“千米”,小于1000米的时候显示单位为“米” |
| | | var cHeightM = Viewer.camera.positionCartographic.height; |
| | |
| | | // "</span>"; |
| | | // } |
| | | // }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |