diff --git a/src/views/DialogTabs/component/streetscape.vue b/src/views/DialogTabs/component/streetscape.vue index dfe9163..1b59a72 100644 --- a/src/views/DialogTabs/component/streetscape.vue +++ b/src/views/DialogTabs/component/streetscape.vue @@ -1,10 +1,10 @@ @@ -32,28 +32,30 @@ }); }; //根据中心点查找poi -// const searchPoiByLonlat = async () => { -// let poiData = await request({ -// url: `/bdApi/baiduservice/placeSearch`, -// method: 'GET', -// params: { -// location: `${AllData.poiCircle[1]},${AllData.poiCircle[0]}`, -// radius: 200, -// query: '公交站$商场$著名景点$学校', -// }, -// }); -// if (poiData & poiData.data.length) { -// console.log('poiData---', poiData); -// element.image = getStreetImg([element.location.lng, element.location.lat]); -// poiData.data.forEach(element => { -// AllData.poiImages.push({ -// name: element.name, -// lonlat: [element.location.lng, element.location.lat], -// imagesUrl: element.image, -// }); -// }); -// } -// }; +const searchPoiByLonlat = async () => { + AllData.poiImages = []; + let poiData = await request({ + url: `/bdApi/baiduservice/placeSearch`, + method: 'GET', + params: { + location: `${AllData.poiCircle[1]},${AllData.poiCircle[0]}`, + radius: 200, + query: '公交站$商场$著名景点$学校', + }, + }); + if (poiData & poiData.data.length) { + console.log('poiData---', poiData); + element.image = getStreetImg([element.location.lng, element.location.lat]); + poiData.data.forEach(element => { + AllData.poiImages.push({ + name: element.name, + lonlat: [element.location.lng, element.location.lat], + imagesUrl: element.image, + }); + }); + } + console.log('AllData.poiImages---', AllData.poiImages); +}; //获取全景静态图 const getStreetImg = async lonlat => { let data = await request({ @@ -73,10 +75,6 @@ }; onMounted(() => { initePanoramaMap(); - // AllData.panorama.addEventListener('position_changed', function (pos) { - // console.log('pos---', pos); - // // AllData.panorama.setPosition(new BMapGL.Point(pos.lng, pos.lat)); - // }); bus.on('streetPosition', e => { console.log('streetPosition---', e); let position_Street = turf.point(e);