| | |
| | | <div class="mapMode"> |
| | | <div class="title" style="margin-top: 0px">地图模式</div> |
| | | <div class="container"> |
| | | <div |
| | | class="layerItem" |
| | | :key="value.id" |
| | | v-for="(value, index) in eMapModeList" |
| | | @click.stop="handleEMapClick(value, index)" |
| | | > |
| | | <img |
| | | :src="value.src" |
| | | :class="{ active: curEMapModelIndex == index }" |
| | | /> |
| | | <div class="layerItem" :key="value.id" v-for="(value, index) in eMapModeList" |
| | | @click.stop="handleEMapClick(value, index)"> |
| | | <img :src="value.src" :class="{ active: curEMapModelIndex == index }" /> |
| | | <span :class="{ spanActive: curEMapModelIndex == index }">{{ |
| | | value.name |
| | | }}</span> |
| | | </div> |
| | | <div |
| | | class="layerItem" |
| | | :key="value0.id" |
| | | v-for="(value0, index0) in sMapModelList" |
| | | @click.stop="handleSMapClick(value0, index0)" |
| | | > |
| | | <img |
| | | :src="value0.src" |
| | | :class="{ active: curSMapModelIndex == index0 }" |
| | | /> |
| | | <div class="layerItem" :key="value0.id" v-for="(value0, index0) in sMapModelList" |
| | | @click.stop="handleSMapClick(value0, index0)"> |
| | | <img :src="value0.src" :class="{ active: curSMapModelIndex == index0 }" /> |
| | | <span :class="{ spanActive: curSMapModelIndex == index0 }">{{ |
| | | value0.name |
| | | }}</span> |
| | |
| | | <div class="title"> |
| | | 专题应用 |
| | | <!-- 不显示更多图层 --> |
| | | <span class="more" v-show="false" @click.stop="showLayerTree" |
| | | >更多图层<i class="el-icon-arrow-right"></i |
| | | ></span> |
| | | <span class="more" v-show="false" @click.stop="showLayerTree">更多图层<i class="el-icon-arrow-right"></i></span> |
| | | </div> |
| | | <div class="container"> |
| | | <div |
| | | class="layerItem" |
| | | v-for="(ZTValue, ZTIndex) in zhuantiList" |
| | | :key="ZTValue.id" |
| | | @click.stop="handleZTlick(ZTValue, ZTIndex)" |
| | | > |
| | | <div class="layerItem" v-for="(ZTValue, ZTIndex) in zhuantiList" :key="ZTValue.id" |
| | | @click.stop="handleZTlick(ZTValue, ZTIndex)"> |
| | | <img :src="ZTValue.src" :class="{ active: curZTIndex == ZTIndex }" /> |
| | | <span :class="{ spanActive: curZTIndex == ZTIndex }">{{ |
| | | ZTValue.name |
| | |
| | | </div> |
| | | <div class="title2"></div> |
| | | <div class="container"> |
| | | <div |
| | | class="layerItem" |
| | | v-for="(funcValue, funcIndex) in FuncList" |
| | | :key="funcValue.id" |
| | | @click.stop="handleFuncClick(funcIndex)" |
| | | > |
| | | <img |
| | | :src="funcValue.src" |
| | | :class="{ active: curFuncIndex == funcIndex }" |
| | | /> |
| | | <div class="layerItem" v-for="(funcValue, funcIndex) in FuncList" :key="funcValue.id" |
| | | @click.stop="handleFuncClick(funcIndex)"> |
| | | <img :src="funcValue.src" :class="{ active: curFuncIndex == funcIndex }" /> |
| | | <span :class="{ spanActive: curFuncIndex == funcIndex }">{{ |
| | | funcValue.name |
| | | }}</span> |
| | |
| | | handleEMapClick(result, index) { |
| | | // 设置相机 |
| | | if (result.name == "二维地图") { |
| | | window.map.getLayerByName("二维地图").setVisible(true); |
| | | window.map.getLayerByName("影像地图").setVisible(false); |
| | | window.mapapi.getLayerByName("二维地图").setVisible(true); |
| | | window.mapapi.getLayerByName("影像地图").setVisible(false); |
| | | } else if (result.name == "影像地图") { |
| | | window.map.getLayerByName("影像地图").setVisible(true); |
| | | window.map.getLayerByName("二维地图").setVisible(false); |
| | | window.mapapi.getLayerByName("影像地图").setVisible(true); |
| | | window.mapapi.getLayerByName("二维地图").setVisible(false); |
| | | } |
| | | // 切换图层 |
| | | const val = layers.filter((res) => { |
| | |
| | | divPoint3 && divPoint3.deleteObject(); |
| | | store.setPoplayerShowAction(false); |
| | | if (window.tdglLine) { |
| | | sgworld.Creator.DeleteObject(window.tdglLine); |
| | | window.mapapi.removeLayer(window.tdglLine); |
| | | window.tdglLine = null; |
| | | } |
| | | this.curFuncIndex = -1; |
| | | window.clusterLayer && window.clusterLayer.clear(); |
| | | if (window.tdglLayer) { |
| | | store.setSliderShow(false); |
| | | sgworld.Creator.DeleteObject(window.tdglLayer); |
| | | window.mapapi.removeLayer(window.tdglLayer); |
| | | } |
| | | } else { |
| | | // 隐藏底部图层面版 |
| | |
| | | this.curFuncIndex = index; |
| | | switch (index) { |
| | | case 0: |
| | | if (window.tdgllayer) { |
| | | window.mapapi.removeLayer(window.tdgllayer); |
| | | store.setSliderShow(false); |
| | | window.tdgllayer = null; |
| | | window.mapapi.removeLayer(window.tdglLine); |
| | | return; |
| | | } |
| | | store.setSliderShow(true); |
| | | // window.tdglLayer = sgworld.Creator.createImageryProvider( |
| | | // layers[8].name, |
| | | // "tms", |
| | | // { |
| | | // id: layers[8].children[0].id, |
| | | // url: layers[8].children[0].urls, |
| | | // fileExtension: layers[8].children[0].img || "png", |
| | | // enablePickFeatures: false, |
| | | // level: layers[8].children[0].Level, |
| | | // minimumLevel: layers[8].children[0].minimumLevel, |
| | | // maximumLevel: layers[8].children[0].maximumLevel, |
| | | // tilingScheme: |
| | | // layers[8].children[0].tileType === "Geo" |
| | | // ? new Cesium.GeographicTilingScheme() |
| | | // : new Cesium.WebMercatorTilingScheme(), |
| | | // // alpha: layers[8].children[0].alpha, |
| | | // alpha: this.alpha, |
| | | // }, |
| | | // "0", |
| | | // layers[8].children[0].zIndex, |
| | | // true, |
| | | // "" |
| | | // ); |
| | | |
| | | // console.log("gisserver-tms"); |
| | | // var url = layers[8].children[0].urls; |
| | | // var projection = getProjection("EPSG:4326"); |
| | | // var tileGrid = createXYZ({ |
| | | // extent: projection.getExtent(), |
| | | // }); |
| | | // var source = new XYZ({ |
| | | // projection: projection, |
| | | // tileGrid: tileGrid, |
| | | // tileUrlFunction: function (tileCoord, pixelRatio, proj) { |
| | | // return ( |
| | | // url + |
| | | // (tileCoord[0] - 1) + |
| | | // "/" + |
| | | // tileCoord[1] + |
| | | // "/" + |
| | | // (Math.pow(2, tileCoord[0] - 1) + tileCoord[2]) + |
| | | // ".jpeg" |
| | | // ); |
| | | // }, |
| | | // }); |
| | | // window.tdglLayer = new Tile({ |
| | | // source: source, |
| | | // }); |
| | | // window.map.addLayer(window.tdglLayer); |
| | | var url = layers[8].children[0].urls; |
| | | //"https://skyzt.bda.gov.cn/gisserver/tmsserver/chengshiguihua_dikuaibianhao_tms/"; |
| | | |
| | | // var url = |
| | | // "https://skyzt.bda.gov.cn/gisserver/tmsserver/chengshiguihua_dikuaibianhao_tms/"; |
| | | |
| | | var tmslayer = new ol.layer.Tile({ |
| | | window.mapapi.removeLayer(window.tdgllayer); |
| | | window.tdgllayer = new ol.layer.Tile({ |
| | | source: new ol.source.XYZ({ |
| | | projection: projection, |
| | | projection: "EPSG:4326", |
| | | tileGrid: ol.tilegrid.createXYZ({ |
| | | extent: [50.731, -90, 180, 70.0478], |
| | | extent: [50.582, -90, 180, 70.1558], |
| | | }), |
| | | tileUrlFunction: function (tileCoord, pixelRatio, proj) { |
| | | // return url + (tileCoord[0] - 1) + '/' + tileCoord[1] + '/' + (Math.pow(2, tileCoord[0] - 1) + tileCoord[2]) + '.jpeg'; |
| | | return ( |
| | | url + |
| | | "/" + |
| | | (tileCoord[0] - 1) + |
| | | "/" + |
| | | tileCoord[1] + |
| | |
| | | }, |
| | | }), |
| | | }); |
| | | window.map.addLayer(tmslayer); |
| | | window.mapapi.addLayer(window.tdgllayer); |
| | | //显示滑动条 |
| | | store.setTdglFlag(true); |
| | | break; |
| | | case 1: |
| | | this.curFuncIndex = -1; |
| | | store.setTdglFlag(false); |
| | | store.setSliderShow(false); |
| | | store.setHistoryShow(true); |
| | | if (window.tdglLayer) { |
| | | store.setSliderShow(false); |
| | | sgworld.Creator.DeleteObject(window.tdglLayer); |
| | | window.mapapi.removeLayer(window.tdgllayer); |
| | | } |
| | | store.setHistoryShow(true); |
| | | break; |
| | | } |
| | | } |
| | |
| | | immediate: true, //刷新加载 立马触发一次handler |
| | | deep: true, // 可以深度检测到 obj 对象的属性值的变化 |
| | | }, |
| | | // "state1.alpha": { |
| | | // handler: function (newVal) { |
| | | // this.handleFuncClick(0); |
| | | // }, |
| | | // deep: true, |
| | | // }, |
| | | }, |
| | | computed: { |
| | | alpha() { |
| | |
| | | line-height: 25px; |
| | | margin: 10px 0px 10px 0; |
| | | } |
| | | |
| | | .title2 { |
| | | height: 15px; |
| | | } |
| | | |
| | | .container { |
| | | display: flex; |
| | | align-items: center; |