| | |
| | | </div> |
| | | </div> |
| | | <div v-else> |
| | | <div class="ssjg" v-show="ssjgxs">请输入关键词搜索地图</div> |
| | | <div class="ssjg" v-show="ssjgxs">未搜索到结果</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | // data.data && data.data.pois; |
| | | //115接口 |
| | | if (data[0].status == 200) { |
| | | data[0].data.data.res |
| | | .filter((item) => { |
| | | return item.name.includes(this.poi_text); |
| | | }) |
| | | .forEach((val) => { |
| | | Allresults.push(val); |
| | | }); |
| | | data[0].data.data.res && |
| | | data[0].data.data.res |
| | | .filter((item) => { |
| | | return item.name.includes(this.poi_text); |
| | | }) |
| | | .forEach((val) => { |
| | | Allresults.push(val); |
| | | }); |
| | | } |
| | | // 市级平台 |
| | | // // 百度 |
| | |
| | | // } |
| | | // 高德 |
| | | if (data[1].data.status == 1) { |
| | | 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); |
| | | }); |
| | | data[1].data.pois && |
| | | 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; |
| | |
| | | .then((res) => { |
| | | // 高德 |
| | | if (res.data.status == 1) { |
| | | 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); |
| | | }); |
| | | res.data.pois && |
| | | res.data.pois |
| | | .filter((item) => { |
| | | var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g"); |
| | | return ( |
| | | item.pname.includes("北京") && |
| | | item.name.includes(this.poi_text) && |
| | | !reg.test(item.typecode) |
| | | ); |
| | | }) |
| | | .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; |
| | |
| | | }) |
| | | .then((res) => { |
| | | if (res.status == 200) { |
| | | res.data.data.res |
| | | .filter((item) => { |
| | | return item.name.includes(this.poi_text); |
| | | }) |
| | | .forEach((val) => { |
| | | Allresults.push(val); |
| | | }); |
| | | res.data.data.res && |
| | | res.data.data.res |
| | | .filter((item) => { |
| | | // 判断地块是否有汉字 |
| | | var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g"); |
| | | return ( |
| | | item.name.includes(this.poi_text) && |
| | | reg.test(item.typecode) |
| | | ); |
| | | }) |
| | | .forEach((val) => { |
| | | Allresults.push(val); |
| | | }); |
| | | } |
| | | this.total = Allresults.length; |
| | | this.poiList = Allresults; |