| | |
| | | <script> |
| | | |
| | | import { reportLocationSearch } from '../../../../api/request' |
| | | // import { pulseEffect } from '../../../../utils/utils' |
| | | import { pulseEffect } from '../../../../utils/utils' |
| | | export default { |
| | | name: 'ReportLocationSearch', |
| | | data () { |
| | |
| | | methods: { |
| | | // 获得焦点 进行定位 |
| | | focusLocation () { |
| | | console.log(this.clickLocation) |
| | | console.log(window.map.getZoom()) |
| | | console.log(window.map.getBounds()) |
| | | // console.log(this.clickLocation) |
| | | // console.log(window.map.getZoom()) |
| | | // console.log(window.map.getBounds()) |
| | | const getBoundsData = '' + window.map.getBounds()._southWest.lng + ',' + window.map.getBounds()._southWest.lat + ',' + window.map.getBounds()._northEast.lng + ',' + window.map.getBounds()._northEast.lat |
| | | const data = { |
| | | postStr: { |
| | |
| | | }, |
| | | type: 'query' |
| | | } |
| | | console.log(data) |
| | | // console.log(data) |
| | | reportLocationSearch(data).then(res => { |
| | | // console.log(res) |
| | | const as = res.pois[0].lonlat.trim().split(' ') |
| | | window.map.setView([as[1], as[0]], 17) |
| | | // for (let i = 0; i < res.pois.length; i++) { |
| | | // const as = res.pois[i].lonlat.trim().split(' ') |
| | | // window.map.flyTo([as[0], as[1]], 16) |
| | | // } |
| | | // window.map.setView(as, 17) |
| | | console.log(res) |
| | | // const as = res.pois[0].lonlat.trim().split(' ') |
| | | // window.map.setView([as[1], as[0]], 17) |
| | | // pulseEffect([as[1], as[0]]) |
| | | for (let i = 0; i < res.pois.length; i++) { |
| | | const as = res.pois[i].lonlat.trim().split(' ') |
| | | if (res.pois[i].name.indexOf(this.clickLocation) >= 0) { |
| | | window.map.setView([as[1], as[0]], 17) |
| | | pulseEffect([as[1], as[0]]) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 点击确认按钮事件 |