| | |
| | | <template> |
| | | <div> |
| | | <div id="sdkContainer"></div> |
| | | <div class="listBox" v-show="viewer1Show && !isLand"> |
| | | <ul> |
| | | <li v-for="(item, index) in arr" :key="index" @click="changeLeftMap($event, item, index)"> |
| | | {{ item }} |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <layerTreeTwoScreen v-if="layerTreeTwoScreen" /> |
| | | <!-- <div id="bottomInfo" v-html="bottomInfo"></div> --> |
| | | <div id="switchImagerLayer" :style="{ |
| | |
| | | }"> |
| | | <transition name="animate__animated animate__bounce" @click="switchImagerLayerShowOrHide" |
| | | enter-active-class="animate__backInRight" leave-active-class="animate__backOutRight" appear> |
| | | <switchImagerLayer v-show="switchImagerLayer" /> |
| | | <switchImagerLayer ref="switchImagerLayer" v-show="switchImagerLayer" /> |
| | | </transition> |
| | | |
| | | <img class="swichImg" @click="switchImagerLayerShowOrHide" :src="switchImage" /> |
| | |
| | | import jiejing from "@/assets/img/new/jiejing.png"; |
| | | import "animate.css"; |
| | | import Bus from "@tools/Bus"; |
| | | |
| | | let activeLi, nLayer,LWLayer; |
| | | export default { |
| | | name: "viewer", |
| | | components: { |
| | |
| | | scale: "1", |
| | | 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, |
| | | ], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["layerTreeTwoScreen", "cesiumInit"]), |
| | | ...mapState(["viewer1Show", "isLand", "layerTreeTwoScreen", "cesiumInit"]), |
| | | }, |
| | | watch: { |
| | | viewer1Show(newvalue, oldvalue) { |
| | | if (!newvalue) { |
| | | this.destroyImageLayer(); |
| | | } |
| | | }, |
| | | isLand(newvalue, oldvalue) { |
| | | if (newvalue) { |
| | | this.destroyImageLayer(); |
| | | } |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(function () { |
| | |
| | | window.sgworld = new SmartEarth.EarthCtrl( |
| | | "sdkContainer", |
| | | { |
| | | // StaticFileBaseUrl: "../../../static/CimSDK/", |
| | | StaticFileBaseUrl: "../../../YZXNCS/static/CimSDK/", |
| | | StaticFileBaseUrl: "../../../static/CimSDK/", |
| | | // StaticFileBaseUrl: "../../../SW/static/CimSDK/", |
| | | }, |
| | | {}, |
| | | {}, |
| | |
| | | return ratio; |
| | | //this.onresize_height = ratio; |
| | | // return ratio; |
| | | }, |
| | | changeMode(mode) { |
| | | this.$refs.switchImagerLayer.switchImagerLayerClick(mode); |
| | | }, |
| | | setImageComparison(isStart) { |
| | | this.isImage = isStart; |
| | | if (!this.isImage) { |
| | | this.destroyImageLayer(); |
| | | } |
| | | }, |
| | | destroyImageLayer() { |
| | | if (activeLi) { |
| | | activeLi.classList.remove('active'); |
| | | activeLi = null; |
| | | } |
| | | if (nLayer) { |
| | | Viewer.imageryLayers.remove(nLayer, true); |
| | | nLayer = null; |
| | | } |
| | | if (LWLayer) { |
| | | Viewer.imageryLayers.remove(LWLayer, true); |
| | | LWLayer = null; |
| | | } |
| | | }, |
| | | changeLeftMap(event, item, index) { |
| | | let liObj = event.currentTarget; |
| | | if (activeLi) { |
| | | activeLi.classList.remove('active'); |
| | | activeLi = null; |
| | | } |
| | | liObj.classList.add('active'); |
| | | activeLi = liObj; |
| | | this.loadImageLayer(item); |
| | | }, |
| | | loadImageLayer(year) { |
| | | if (nLayer) { |
| | | Viewer.imageryLayers.remove(nLayer, true); |
| | | nLayer = null; |
| | | } |
| | | nLayer = this.loadBJ54ImageLayer(year); |
| | | if(!LWLayer) |
| | | { |
| | | LWLayer = this.loadBJ54LWLayer(); |
| | | } |
| | | }, |
| | | loadBJ54LWLayer() { |
| | | let url = "http://172.26.64.84/service/ImageEngine/picdis/abc"; |
| | | //let url = option.url; |
| | | //let year = option.year; |
| | | let paramUrl = `${url}?user=jjjskfq&password=Jjjskfq@2022&layer=Shiliang_Lw_2019&style=&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={nx}&TileRow={ny}`; |
| | | let minx = 113.168199 * Math.PI / 180.0; |
| | | let miny = 39.230551 * Math.PI / 180.0; |
| | | let maxx = 118.562362 * Math.PI / 180.0; |
| | | let maxy = 41.294714 * Math.PI / 180.0; |
| | | let rectangle = new Cesium.Rectangle(minx, miny, maxx, maxy); |
| | | let tilingScheme = new Cesium.GeographicTilingScheme({ |
| | | rectangle: rectangle, |
| | | numberOfLevelZeroTilesX: 2, |
| | | numberOfLevelZeroTilesY: 1 |
| | | }); |
| | | var dx = { |
| | | url: paramUrl, |
| | | tilingScheme: tilingScheme, |
| | | customTags: { |
| | | nx: function (imageryProvider, x, y, level) { |
| | | return (2 << (level - 1)) + x; |
| | | }, |
| | | 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 }); |
| | | Viewer.imageryLayers.add(imageLayer, 3); |
| | | return imageLayer; |
| | | }, |
| | | loadBJ54ImageLayer(year) { |
| | | let url = "http://172.26.64.84/service/ImageEngine/picdis/abc"; |
| | | //let url = option.url; |
| | | //let year = option.year; |
| | | let paramUrl = `${url}?user=jjjskfq&password=Jjjskfq@2022&layer=Sate_${year}&style=&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={nx}&TileRow={ny}`; |
| | | let minx = 113.168199 * Math.PI / 180.0; |
| | | let miny = 39.230551 * Math.PI / 180.0; |
| | | let maxx = 118.562362 * Math.PI / 180.0; |
| | | let maxy = 41.294714 * Math.PI / 180.0; |
| | | let rectangle = new Cesium.Rectangle(minx, miny, maxx, maxy); |
| | | let tilingScheme = new Cesium.GeographicTilingScheme({ |
| | | rectangle: rectangle, |
| | | numberOfLevelZeroTilesX: 2, |
| | | numberOfLevelZeroTilesY: 1 |
| | | }); |
| | | var dx = { |
| | | url: paramUrl, |
| | | tilingScheme: tilingScheme, |
| | | customTags: { |
| | | nx: function (imageryProvider, x, y, level) { |
| | | return (2 << (level - 1)) + x; |
| | | }, |
| | | 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 }); |
| | | Viewer.imageryLayers.add(imageLayer, 2); |
| | | return imageLayer; |
| | | }, |
| | | changeImage(val) { |
| | | switch (val) { |
| | |
| | | z-index: -1; |
| | | } |
| | | |
| | | .listBox { |
| | | position: absolute; |
| | | left: 20px; |
| | | top: 100px; |
| | | |
| | | } |
| | | |
| | | .listBox .active { |
| | | |
| | | background: rgba(255, 166, 0, 0.808); |
| | | |
| | | } |
| | | |
| | | .listBox li { |
| | | padding: 2px; |
| | | margin-top: 1px; |
| | | border-radius: 2px; |
| | | color: white; |
| | | background: rgba(14, 50, 143, 0.6); |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | /* 屏幕分辨率放大为 125 */ |
| | | @media (-webkit-min-device-pixel-ratio: 1.25) { |
| | | .listBox li { |
| | | font-size: 12px; |
| | | } |
| | | } |
| | | |
| | | .listBox li:hover { |
| | | background: rgba(255, 166, 0, 0.808); |
| | | } |
| | | |
| | | .mid { |
| | | position: absolute; |
| | | top: 50%; |