From 0362dbf2495b3281607f7c74b160a78c923fb6b4 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期二, 23 一月 2024 11:51:29 +0800 Subject: [PATCH] 定位 --- src/components/leftMenu/sousuo.vue | 101 +++++++++++++++++++++------------ src/utils/map.js | 17 +++-- static/json/layer.js | 19 +++++- src/utils/poiKeys.js | 5 + src/components/poplayer/poplayer.vue | 2 src/components/rightNavigation/NavigationBar.vue | 14 +++- 6 files changed, 103 insertions(+), 55 deletions(-) diff --git a/src/components/leftMenu/sousuo.vue b/src/components/leftMenu/sousuo.vue index a0f0477..13d2cda 100644 --- a/src/components/leftMenu/sousuo.vue +++ b/src/components/leftMenu/sousuo.vue @@ -183,12 +183,14 @@ background: rgba(218, 218, 218, 0.1); } </style> + + <script> let timers = null; - import axios from "axios"; import store from "@/utils/store.js"; import common from "@/components/common"; + window.flyPoint = null; window.flyLine = null; let Allresults = []; @@ -368,28 +370,41 @@ // } // 楂樺痉 if (data[1].data.status == 1) { - data[1].data.pois.forEach((val) => { - let poiarr = val.location.split(","); - let poi = { - lon: parseFloat(poiarr[0]), - lat: parseFloat(poiarr[1]), - }; - let obj = { - address: val.address, - adname: val.area, - cityname: val.city, - id: val.uid, - lat: poi.lat, - lng: poi.lon, - name: val.name, - pname: val.province, - }; - Allresults.push(obj); - }); + data[1].data.pois + .filter((item) => { + return ( + item.pname.includes("鍖椾含") && + item.name.includes(this.poi_text) + ); + }) + .forEach((val) => { + let poiarr = val.location.split(","); + let poi = { + lon: parseFloat(poiarr[0]), + lat: parseFloat(poiarr[1]), + }; + let obj = { + adcode: val.adcode, + address: val.address, + adname: val.area, + citycode: val.citycode, + cityname: val.cityname, + id: val.uid, + lat: poi.lat, + lng: poi.lon, + name: val.name, + pcode: val.pcode, + pname: val.province, + type: val.type, + typecode: val.typecode, + }; + Allresults.push(obj); + }); } this.total = Allresults.length; this.poiList = Allresults; this.showList = true; + console.log(Allresults); }, (response) => { console.log("error"); @@ -411,24 +426,36 @@ .then((res) => { // 楂樺痉 if (res.data.status == 1) { - res.data.pois.forEach((val) => { - let poiarr = val.location.split(","); - let poi = { - lon: parseFloat(poiarr[0]), - lat: parseFloat(poiarr[1]), - }; - let obj = { - address: val.address, - adname: val.area, - cityname: val.city, - id: val.uid, - lat: poi.lat, - lng: poi.lon, - name: val.name, - pname: val.province, - }; - Allresults.push(obj); - }); + res.data.pois + .filter((item) => { + return ( + item.pname.includes("鍖椾含") && + item.name.includes(this.poi_text) + ); + }) + .forEach((val) => { + let poiarr = val.location.split(","); + let poi = { + lon: parseFloat(poiarr[0]), + lat: parseFloat(poiarr[1]), + }; + let obj = { + adcode: val.adcode, + address: val.address, + adname: val.area, + citycode: val.citycode, + cityname: val.cityname, + id: val.uid, + lat: poi.lat, + lng: poi.lon, + name: val.name, + pcode: val.pcode, + pname: val.province, + type: val.type, + typecode: val.typecode, + }; + Allresults.push(obj); + }); } this.total = Allresults.length; this.poiList = Allresults; diff --git a/src/components/poplayer/poplayer.vue b/src/components/poplayer/poplayer.vue index 6c9155c..de6c90e 100644 --- a/src/components/poplayer/poplayer.vue +++ b/src/components/poplayer/poplayer.vue @@ -67,7 +67,7 @@ .Poplayer { /* min-width: 350px; */ width: 80vw; - min-height: 180px; + /* min-height: 180px; */ background-repeat: no-repeat; background-size: 100% 100%; background-image: url("./img/bg.png"); diff --git a/src/components/rightNavigation/NavigationBar.vue b/src/components/rightNavigation/NavigationBar.vue index 969199d..3db494c 100644 --- a/src/components/rightNavigation/NavigationBar.vue +++ b/src/components/rightNavigation/NavigationBar.vue @@ -5,8 +5,6 @@ <img src="@/assets/img/navigation/menuicon.png" /> </el-button> </div> - <!-- <div class="menuBtn" @click="handleMenuListShow"></div> --> - <div class="menuList" v-show="showMenuList.show"> <ul> <li @@ -106,6 +104,7 @@ }; }, methods: { + // 鐐瑰嚮鍙充笂瑙掕彍鍗曟寜閽� handleMenuListShow() { // 娓呴櫎瀹氱偣缁曢 if (window.pointerFly) { @@ -118,9 +117,16 @@ this.showMenuList.show = !this.showMenuList.show; store.setMenuListShow(this.showMenuList.show); }, + + // 鐐瑰嚮鍙充笂瑙掕彍鍗曢」 handleMenuClick(attr) { - debugger; - //娓呴櫎鐐� + // debugger; + // 娓呴櫎瀹氱偣缁曢 + if (window.pointerFly) { + window.pointerFly.end && window.pointerFly.end(); + window.pointerFly = null; + } + //娓呴櫎鎼滅储鐐� flyPoint && Viewer.entities.remove(flyPoint); flyPoint = undefined; switch (attr) { diff --git a/src/utils/map.js b/src/utils/map.js index 185498f..280127f 100644 --- a/src/utils/map.js +++ b/src/utils/map.js @@ -84,7 +84,6 @@ axios .get(window.gisBaseUrl + '/gisserver/wfsserver/yinjing?version=1.3.0&request=GetFeature&format=json&typename=yz浜曟暟鎹�') .then(res => { - debugger // let manholeList = JSON.parse(res.data); store.setLayerPanelShow(false); res.data.features.forEach((item, index) => { @@ -140,7 +139,6 @@ // axios // .get(window.gisBaseUrl + '/gisserver/wfsserver/qiyelianqiye?version=1.3.0&request=GetFeature&format=json&typename=浼佷笟閾句紒涓�') // .then(res => { -// debugger // // let manholeList = JSON.parse(res.data); // store.setLayerPanelShow(false); // res.data.features.forEach((item, index) => { @@ -183,7 +181,6 @@ axios .get(window.gisBaseUrl + '/gisserver/wfsserver/YZ_SPJK_NEW_wfs?version=1.3.0&request=GetFeature&format=json&typename=鎽勫儚澶�0423') .then(res => { - debugger store.setLayerPanelShow(false); res.data.features.forEach((item, index) => { window.clusterLayer.add( @@ -614,11 +611,11 @@ }) } let nPickFeature = sgworld.Viewer.scene.pick(event.position); - console.log(nPickFeature); - if (nPickFeature == undefined) { - window.flyPoint && Viewer.entities.remove(window.flyPoint); - window.flyPoint = undefined; - } + // console.log(nPickFeature); + // if (nPickFeature == undefined) { + // window.flyPoint && Viewer.entities.remove(window.flyPoint); + // window.flyPoint = undefined; + // } // console.log(event.position);//灞忓箷浣嶇疆 if (!nPickFeature || !nPickFeature.id) { return @@ -715,11 +712,14 @@ return } else if (propertyNames.indexOf("閮ㄤ欢鍚嶇О") !== -1) { objdata = { + // 鐐逛綅绫诲瀷锛堜腑鑻辨枃閰嶇疆琛╬oiKeys.js) POITYPE: "CSBJ", + // 灞曠ず瀛楁 name: properties["閮ㄤ欢鍚嶇О"]._value, address: properties["瀹夎鍦板潃"]._value, code: properties["閮ㄤ欢缂栫爜"]._value, type: properties["閮ㄤ欢绫诲瀷"]._value, + // 寮规缁忕含搴� lon: lon, lat: lat, } @@ -748,6 +748,7 @@ objdata = { POITYPE: "POINT", name: properties["_name"]._value, + address: properties["_address"]._value, lat: properties["_lat"]._value, lon: properties["_lng"]._value, } diff --git a/src/utils/poiKeys.js b/src/utils/poiKeys.js index 9144491..6311f74 100644 --- a/src/utils/poiKeys.js +++ b/src/utils/poiKeys.js @@ -44,8 +44,9 @@ }, 'POINT': { 鍚嶇О: 'name', - 缁忓害: 'lon', - 绾害: 'lat' + // 缁忓害: 'lon', + // 绾害: 'lat', + 鍦板潃: 'address' } } export default keys \ No newline at end of file diff --git a/static/json/layer.js b/static/json/layer.js index e62bba9..6c2dfa2 100644 --- a/static/json/layer.js +++ b/static/json/layer.js @@ -76,12 +76,25 @@ { name: '褰卞儚鍦板浘', children: [ - + { + "id": "69EB42A8", + "sourceType": "gdmap", + "name": "楂樺痉娉ㄨ", + "urls": "https://webst02.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}", + "layer": "", + "alpha": 1, + "maximumLevel": 18, + "zIndex": 2, + "Level": "0,26", + "checked": false, + "rename": false + }, { "id": "C0698021", "sourceType": "arcgis", "name": "鑸媿褰卞儚", "urls": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", + "layer": "", // "alpha": 1, "zIndex": 1, // "Level": "0,26", @@ -112,7 +125,7 @@ "maximumLevel": 26, "alpha": 1, "zIndex": 7, - "Level": "11,20", + "Level": "10,20", "checked": false, "rename": false, "flyTo": [ @@ -131,7 +144,7 @@ "maximumLevel": 26, "alpha": 1, "zIndex": 7, - "Level": "10,20", + "Level": "9,20", "flyTo": [ "116.50281", "39.75291", -- Gitblit v1.9.3