| | |
| | | longPos: '', |
| | | latPos: '' |
| | | }, |
| | | marker: null |
| | | marker: window.L.layerGroup().addTo(window.map), |
| | | layersGroupArrList: [] |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }) |
| | | }) |
| | | window.map.addLayer(this.marker) |
| | | this.layersGroupArrList.push(this.marker) |
| | | window.map.off('click') |
| | | }) |
| | | }, |
| | |
| | | this.marker = window.L.marker(as, { |
| | | icon: window.L.icon({ |
| | | iconUrl: iconUrl, |
| | | iconSize: [30, 40], |
| | | iconAnchor: [15, 20] |
| | | iconSize: [26, 40], |
| | | iconAnchor: [13, 20] |
| | | }) |
| | | }) |
| | | window.map.addLayer(this.marker) |
| | | this.layersGroupArrList.push(this.marker) |
| | | } else { |
| | | this.$message('请输入识取经纬度') |
| | | } |
| | | }, |
| | | // 点击确认按钮事件 |
| | | confirm () { |
| | | for (let i = 0; i < this.layersGroupArrList.length; i++) { |
| | | window.map.removeLayer(this.layersGroupArrList[i]) |
| | | } |
| | | window.mapManager.clearHighlight() |
| | | window.map.removeLayer(this.marker) |
| | | // window.map.removeLayer(this.marker) |
| | | eventBus.$emit('location-setChange', true) |
| | | this.lonlatpos.longPos = '' |
| | | this.lonlatpos.latPos = '' |
| | |
| | | <template> |
| | | <div class="click-location"> |
| | | <el-row> |
| | | <!-- clearable--> |
| | | <el-input type="text" v-model="clickLocation" @change="focusLocation"> |
| | | <el-button slot="suffix" type="text" @click="focusLocation"> |
| | | <img src="../../../../../public/assets/images/map/emergency/search.png" alt=""> |
| | |
| | | // 点击定位绑定数据 |
| | | clickLocation: '', |
| | | searchList: [], |
| | | marker: null, |
| | | marker: window.L.layerGroup().addTo(window.map), |
| | | layer: window.L.layerGroup().addTo(window.map), |
| | | layersGroupArrList: [], |
| | | total: 0, |
| | | // 分页 默认展示 |
| | | currentPage: 1, |
| | |
| | | } |
| | | // $http.get('http://10.246.133.164//api/search?', data) |
| | | reportLocationSearch(data).then(res => { |
| | | console.log(res) |
| | | // console.log(res) |
| | | this.searchList = res.pois |
| | | this.total = res.pois.length |
| | | // this.searchList = res.statistics.priorityCitys |
| | | // this.total = res.statistics.priorityCitys.length |
| | | }) |
| | | }, |
| | | // 点击定位 |
| | | locationMapClick (val, index) { |
| | | this.activeNum = index |
| | | // console.log(val) |
| | | const ps = val.lonlat.trim().split(' ') |
| | | // const htmls = '<div><ul><li>' + val.name + '</li></ul></div>' |
| | | // var myIcon = window.L.divIcon({ |
| | | // html: htmls, |
| | | // className: 'company-bindTooltip', |
| | | // iconSize: 16 |
| | | // }) |
| | | this.marker = window.L.marker([ps[1], ps[0]], { |
| | | icon: window.L.icon({ |
| | | iconUrl: iconUrl, |
| | | iconSize: [25, 40], |
| | | iconAnchor: [15, 15] |
| | | iconSize: [26, 40], |
| | | iconAnchor: [13, 20] |
| | | }) |
| | | // icon: myIcon |
| | | }) |
| | | .bindTooltip(val.name, { |
| | | permanent: 'true', |
| | |
| | | className: '' |
| | | }) |
| | | window.map.addLayer(this.marker) |
| | | this.layersGroupArrList.push(this.marker) |
| | | window.map.setView([ps[1], ps[0]], 17) |
| | | pulseEffect([ps[1], ps[0]]) |
| | | }, |
| | | // 点击确认按钮事件 |
| | | confirm () { |
| | | window.mapManager.clearHighlight() |
| | | window.map.removeLayer(this.marker) |
| | | for (let i = 0; i < this.layersGroupArrList.length; i++) { |
| | | window.map.removeLayer(this.layersGroupArrList[i]) |
| | | } |
| | | this.searchList = [] |
| | | this.clickLocation = '' |
| | | this.total = 0 |
| | | eventBus.$emit('location-setChange', true) |
| | | } |
| | | } |
| | |
| | | * 脉冲效果 |
| | | */ |
| | | export function pulseEffect (xy) { |
| | | let times = 5 |
| | | let times = 1000 |
| | | const colors = ['#00f100', '#ff0000'] |
| | | // 插件 效果实现 |
| | | var pulsingIcon = window.L.icon.pulse({ |