From d91f0dfcd2ef95fb3624d94ade24fe69a9169a58 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期日, 04 二月 2024 15:15:00 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.20.92:8888/r/P2022036_Web2 --- src/views/Tools/AddOnlineMap.vue | 230 +++++---------------------------------------------------- 1 files changed, 22 insertions(+), 208 deletions(-) diff --git a/src/views/Tools/AddOnlineMap.vue b/src/views/Tools/AddOnlineMap.vue index 7099322..e5ee2cc 100644 --- a/src/views/Tools/AddOnlineMap.vue +++ b/src/views/Tools/AddOnlineMap.vue @@ -1,60 +1,23 @@ <template> - <Popup - ref="pop" - :title="title" - @close="close(true)" - width="400px" - @yes="addData" - @cancel="close(false)" - > + <Popup ref="pop" :title="title" @close="close(true)" width="400px" @yes="addData" @cancel="close(false)"> - <div - id="archTopBox" - class="archTopBox" - > + <div id="archTopBox" class="archTopBox"> - <div - class="boxCard" - v-for="(item,index) in mapList" - > + <div class="boxCard" v-for="(item, index) in mapList"> <el-card class="box-card"> - <div - slot="header" - class="clearfix" - > - <span style="font-size:14px">{{item.name}}</span> + <div slot="header" class="clearfix"> + <span style="font-size:14px">{{ item.name }}</span> <div style="float: right; padding: 3px 0"> - <i - v-show="!item.isShow" - style="margin-left:10px" - class="el-icon-arrow-up" - :title="$t('archiveObj.fold')" - @click="setCardChange(item)" - ></i> - <i - v-show="item.isShow" - style="margin-left:10px" - class="el-icon-arrow-down" - :title="$t('archiveObj.develop')" - @click="setCardChange(item)" - ></i> + <i v-show="!item.isShow" style="margin-left:10px" class="el-icon-arrow-up" :title="$t('archiveObj.fold')" + @click="setCardChange(item)"></i> + <i v-show="item.isShow" style="margin-left:10px" class="el-icon-arrow-down" + :title="$t('archiveObj.develop')" @click="setCardChange(item)"></i> </div> </div> - <div - :id="item.id" - style="margin:5px 1px" - v-show="!item.isShow" - > + <div :id="item.id" style="margin:5px 1px" v-show="!item.isShow"> <div style="margin:10px;width:380px"> - <div - class="map" - v-for="(map, mapIndex) in item.list" - @click="addImageLayer(map, item)" - > - <img - style="width: 60px; height: 60px" - :src="map.image" - ></img> + <div class="map" v-for="(map, mapIndex) in item.list" @click="addImageLayer(map, item)"> + <img style="width: 60px; height: 60px" :src="map.image"></img> <div> <el-link :underline="false"> {{ map.name }} </el-link></div> @@ -64,29 +27,6 @@ </el-card> </div> - - <!-- <el-collapse :value="activeNames"> - <el-collapse-item - v-for="(mapCollection, index) in mapList" - :title="mapCollection.name" - :name="mapCollection.name" - :key="index" - > - <div - class="map" - v-for="(map, mapIndex) in mapCollection.list" - :key="mapIndex" - @click="addImageLayer(map, mapCollection)" - > - <el-image - style="width: 60px; height: 60px" - :src="require(`@assets/imageLayer/${map.image}`)" - fit="fill" - ></el-image> - <span>{{ map.name }}</span> - </div> - </el-collapse-item> - </el-collapse> --> </div> </el-form> </Popup> @@ -97,7 +37,7 @@ import TileLayer from "ol/layer/Tile" import XYZ from "ol/source/XYZ" // 褰卞儚鍥惧眰 - +import mapLayers from "./layer"; export default { name: "AddOnlineMap", components: { @@ -106,7 +46,7 @@ mixins: [], data() { return { - title: "鍦ㄧ嚎鍦板浘", + title: "3D鍦ㄧ嚎鍦板浘", left: undefined, tokne: "", data: { @@ -120,98 +60,7 @@ zIndex: undefined, }, mapCollection: undefined, - mapList: [{ - name: "Cesium", - sourceType: "cesium", - tokne: "94a34772eb88317fcbf8428e10448561", - maximumLevel: 18, - id: 1, - isShow: true, - list: [{ - name: "Cesium褰卞儚", - image: require("../../assets/img/imageLayer/tdmap_image.jpg"), - urls: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", - },], - }, - - { - name: "澶╁湴鍥�", - sourceType: "tdmap", - tokne: "94a34772eb88317fcbf8428e10448561", - maximumLevel: 18, - id: 1, - isShow: true, - list: [ - { - name: "澶╁湴鍥惧湴鍥�", - image: require("../../assets/img/imageLayer/tdmap_map.jpg"), - urls: "http://t0.tianditu.com/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", - olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=' - }, - { - name: "澶╁湴鍥惧奖鍍�", - image: require("../../assets/img/imageLayer/tdmap_image.jpg"), - urls: "http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", - olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=' - }, - { - name: "澶╁湴鍥惧湴褰�", - image: require("../../assets/img/imageLayer/tdmap_label.jpg"), - urls: "http://t0.tianditu.com/ter_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=ter&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", - olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=ter_w&x={x}&y={y}&l={z}&tk=' - }, - ], - }, - { - name: "楂樺痉鍦板浘", - sourceType: "gdmap", - maximumLevel: 18, - id: 2, - isShow: true, - list: [ - { - name: "楂樺痉鍦板浘", - image: require("../../assets/img/imageLayer/gdmap_map.jpg"), - urls: "https://webst02.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}", - }, - { - name: "楂樺痉褰卞儚", - image: require("../../assets/img/imageLayer/gdmap_image.jpg"), - urls: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", - }, - - ], - }, { - name: '鏈湴鏈嶅姟', - sourceType: 'localmap', - maximumLevel: 22, - id: 3, - isShow: true, - list: [ - { - name: "鍦板浘", - image: require("../../assets/img/imageLayer/gdmap_map.jpg"), - urls: "http://{host}/LFData/2d/tiles/vec/{z}/{x}/{y}.png", - }, - { - name: "褰卞儚", - image: require("../../assets/img/imageLayer/gdmap_image.jpg"), - urls: "http://{host}/LFData/2d/tiles/img/{z}/{x}/{y}.png", - }, - { - name: "鍦板舰", - image: require("../../assets/img/imageLayer/dixing.png"), - urls: "http://{host}/LFData/2d/tiles/ter/{z}/{x}/{y}.png", - }, - { - name: "1:20涓囧尯鍩熷湴璐ㄥ浘", - image: require("../../assets/img/imageLayer/25dizhi.png"), - urls: "http://{host}/LFData/2d/tiles/20w_qydz/{z}/{x}/{y}.png", - }, - ], - } - - ], + mapList: mapLayers, }; }, computed: { @@ -248,12 +97,7 @@ window.Viewer.imageryLayers.remove( window.BaseMapLayer ); - window.map.removeLayer(window.olBaseMapLayer); - if (!is_production) { - if (window.vectorLayer) { - window.map.removeLayer(window.vectorLayer); - } - } + }, addImageLayer(map, mapCollection) { @@ -268,15 +112,7 @@ this.mapCollection = mapCollection; if (mapCollection.sourceType === "cesium") { - window.olBaseMapLayer = new TileLayer({ - title: "楂樺痉鍦板浘", - source: new XYZ({ - url: map.urls, - wrapX: false - }), - zIndex: -1 - }); - window.map.addLayer(window.olBaseMapLayer); + return; } else if (mapCollection.sourceType === "tdmap") { @@ -291,15 +127,7 @@ tileMatrixSetID: "GoogleMapsCompatible", })) - window.olBaseMapLayer = new TileLayer({ - title: "楂樺痉鍦板浘", - source: new XYZ({ - url: map.olUrls + tokne - - }), - zIndex: -1 - }); - window.map.addLayer(window.olBaseMapLayer); + } else if (mapCollection.sourceType === "gdmap") { window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( @@ -309,15 +137,7 @@ }) ); - window.olBaseMapLayer = new TileLayer({ - title: "楂樺痉鍦板浘", - source: new XYZ({ - url: map.urls, - wrapX: false - }), - zIndex: -1 - }); - window.map.addLayer(window.olBaseMapLayer); + } else if (mapCollection.sourceType === "localmap") { var ulr = map.urls; ulr = ulr.replace("{host}", iisHost) @@ -329,15 +149,7 @@ }) ); - window.olBaseMapLayer = new TileLayer({ - title: "楂樺痉鍦板浘", - source: new XYZ({ - url: ulr, - wrapX: false - }), - zIndex: -1 - }); - window.map.addLayer(window.olBaseMapLayer); + } Viewer.imageryLayers.lowerToBottom(window.BaseMapLayer);//灏嗗浘灞傜Щ鍒版渶搴曞眰 Viewer.imageryLayers.raise(window.BaseMapLayer);//灏嗗浘灞傜Щ鍒版渶搴曞眰 @@ -380,6 +192,7 @@ /deep/.el-card__body { padding: 0px !important; } + .map { display: inline-block; cursor: pointer; @@ -391,6 +204,7 @@ border-radius: 4px; } } + .boxCard { margin-bottom: 5px; } -- Gitblit v1.9.3