| | |
| | | <!-- </el-pagination>--> |
| | | </el-row> |
| | | </el-scrollbar> |
| | | <el-row> |
| | | <el-button type="primary" @click="confirm" style="text-align: right">确认</el-button> |
| | | <el-row style="text-align: right"> |
| | | <el-button type="primary" @click="confirm">确认</el-button> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | |
| | | return { |
| | | // 点击定位绑定数据 |
| | | clickLocation: '', |
| | | searchList: [] |
| | | searchList: [], |
| | | marker: null |
| | | } |
| | | }, |
| | | methods: { |
| | | // 获得焦点 进行定位 |
| | | // 搜索定位 |
| | | focusLocation () { |
| | | // console.log(this.clickLocation) |
| | | // console.log(window.map.getZoom()) |
| | |
| | | // } |
| | | // } |
| | | }) |
| | | this.clickLocation = '' |
| | | }, |
| | | // 点击定位 |
| | | locationMapClick (val) { |
| | |
| | | // iconSize: 16 |
| | | // }) |
| | | const htmls = '<div><ul><li>' + val.name + '</li> <br/> <li>' + val.address + '</li> <br/> <li>' + val.phone + '</li></ul></div>' |
| | | const marker = window.L.marker([ps[1], ps[0]], { |
| | | this.marker = window.L.marker([ps[1], ps[0]], { |
| | | icon: window.L.icon({ |
| | | iconUrl: iconUrl, |
| | | iconSize: [30, 30], |
| | |
| | | sticky: true, |
| | | className: '' |
| | | }) |
| | | window.map.addLayer(marker) |
| | | window.map.addLayer(this.marker) |
| | | window.map.setView([ps[1], ps[0]], 17) |
| | | pulseEffect([ps[1], ps[0]]) |
| | | }, |
| | | // 点击确认按钮事件 |
| | | confirm () { |
| | | // 通过子组件向父组件传递数据 |
| | | // this.$emit('locationClick', this.LongLatPos) |
| | | window.mapManager.clearHighlight() |
| | | window.map.removeLayer(this.marker) |
| | | this.searchList = [] |
| | | this.clickLocation = '' |
| | | eventBus.$emit('location-setChange', true) |
| | | // console.log('搜索定位') |
| | | } |
| | | } |
| | | } |