| | |
| | | <template> |
| | | <div class="search" id="search"> |
| | | <div class="searchInput"> |
| | | <el-input |
| | | v-loading="loading" |
| | | :disabled="loading" |
| | | placeholder="请输入地名地址" |
| | | prefix-icon="el-icon-search" |
| | | :clearable="clearable" |
| | | v-model="poi_text" |
| | | @input="changeInput" |
| | | ></el-input> |
| | | <el-input v-loading="loading" :disabled="loading" placeholder="请输入地名地址" prefix-icon="el-icon-search" |
| | | :clearable="clearable" v-model="poi_text" @input="changeInput"></el-input> |
| | | |
| | | <!-- <el-autocomplete v-model="state" :fetch-suggestions="querySearchAsync" placeholder="请输入地名地址" |
| | | @select="handleSelect"></el-autocomplete> --> |
| | |
| | | <div>共找到{{ total }}条结果</div> |
| | | <hr /> |
| | | <div class="searchList"> |
| | | <div |
| | | class="searchItem" |
| | | v-for="(item, index) in poiList" |
| | | :key="index" |
| | | @click="flyTo(item)" |
| | | > |
| | | <div class="searchItem" v-for="(item, index) in poiList" :key="index" @click="flyTo(item)"> |
| | | <el-button> |
| | | <div class="itemName"> |
| | | <i class="el-icon-map-location"></i> |
| | |
| | | this.searching = true; |
| | | axios |
| | | .all([ |
| | | // http://172.26.64.84/service/ImageEngine/picdis/abc?user=jjjskfq&password=Jjjskfq@2022 |
| | | axios.get("http://10.10.4.116:8085/yzAdapter/Navigation", { |
| | | params: { |
| | | request: "bdPoi", |
| | | query: this.poi_text, |
| | | output: "json", |
| | | coord: "cgcs2000", |
| | | page_num: 0, |
| | | page_size: 20, |
| | | }, |
| | | }), |
| | | axios.post("http://10.10.4.115:8022/poisearch/qgpoi/POIQuery", { |
| | | adcode: "110115", |
| | | address: { |
| | | name: "", |
| | | type: "", |
| | | }, |
| | | adname: "大兴区", |
| | | cityname: "北京市", |
| | | name: { |
| | | name: this.poi_text, |
| | | type: "", |
| | | }, |
| | | page: 1, |
| | | perPageCount: 20, |
| | | pcode: "110000", |
| | | pname: "", |
| | | resType: "", |
| | | }), |
| | | axios.get(`http://10.10.4.116:8086/gadapter/poi/text?keyword=${this.poi_text}&output=json&coord=cgcs2000`), |
| | | axios.get(`http://10.10.4.116:8086/cs/selectIndustrialPark?pageIndex=1&pageSize=20&yqmc=${this.poi_text}`), |
| | | ]) |
| | | .then((data) => { |
| | | this.searching = false; |
| | | let Allresults = []; |
| | | // 市级平台 |
| | | if (data[0].data.status == 0) { |
| | | data[0].data.results.forEach((val) => { |
| | | let obj = { |
| | | address: val.address, |
| | | adname: val.area, |
| | | cityname: val.city, |
| | | id: val.uid, |
| | | lat: val.location.lat, |
| | | lng: val.location.lng, |
| | | id: val.id, |
| | | lng: Number(val.location.split(',')[0]), |
| | | lat: Number(val.location.split(',')[1]), |
| | | name: val.name, |
| | | pname: val.province, |
| | | street: val.street, |
| | | tag: val.tag, |
| | | }; |
| | | Allresults.push(obj); |
| | | }); |
| | | } |
| | | //115接口 |
| | | if (data[1].status == 200) { |
| | | data[1].data.data.res |
| | | data[1].data.data |
| | | .filter((item) => { |
| | | return item.name.includes(this.poi_text); |
| | | return item.yqmc.includes(this.poi_text); |
| | | }) |
| | | .forEach((val) => { |
| | | Allresults.push(val); |
| | | let obj = { |
| | | address: val.dz, |
| | | lng: val.x, |
| | | lat: val.y, |
| | | name: val.yqmc, |
| | | }; |
| | | Allresults.push(obj); |
| | | }); |
| | | } |
| | | console.log(Allresults); |
| | | this.total = Allresults.length; |
| | | this.poiList = Allresults; |
| | | this.loading = false; |
| | |
| | | }, |
| | | flyTo(item) { |
| | | flyPoint && Viewer.entities.remove(flyPoint); |
| | | console.log(item); |
| | | |
| | | sgworld.Navigate.flyToPointsInterest({ |
| | | destination: Cesium.Cartesian3.fromDegrees( |
| | | // item.LABELX, |