| | |
| | | offset: [-35, -45], |
| | | labelBg: "#3369FF", |
| | | labelColor: "#fff", |
| | | labelClick, |
| | | labelClick: this.labelClick, |
| | | }; |
| | | // 清除之前的标记 |
| | | this.map && this.map.clearOverLays(); |
| | |
| | | const { lat, lng: lon } = e.lnglat; |
| | | |
| | | this.makeDefaultMask({ |
| | | ...defaultMaskInfo, |
| | | ...this.defaultMaskInfo, |
| | | lon: String(lon), |
| | | lat: String(lat), |
| | | }); |
| | | this.getReverseGeocode(e).then((addr) => { |
| | | this.$emit("mapClick", { e, addr }); |
| | | this.getReverseGeocode(e).then((addr) => { |
| | | this.$emit("mapClick", { |
| | | e, |
| | | addr, |
| | | }); |
| | | }); |
| | | console.log("点击事件", e); |
| | | }, |
| | | |
| | |
| | | } |
| | | |
| | | this.addEvent(marker, "mouseover", (e) => |
| | | markerMouseover(e, infoWin, labelOptions, getUniqueId()) |
| | | this.markerMouseover(e, infoWin, labelOptions, this.getUniqueId()) |
| | | ); |
| | | this.addEvent(marker, "mouseout", (e) => markerMouseout(e, infoWin)); |
| | | this.addEvent(marker, "mouseout", (e) => this.markerMouseout(e, infoWin)); |
| | | }, |
| | | |
| | | // 标记所有点 |
| | |
| | | //标记点击事件 |
| | | markerClick(currentLabel, e) { |
| | | const id = e.target.options.id; |
| | | currentLabelStyleChange(currentLabel); |
| | | this.currentLabelStyleChange(currentLabel); |
| | | console.log("点击事件", e, currentLabel); |
| | | this.getReverseGeocode(e).then((addr) => { |
| | | this.$emit( |
| | |
| | | |
| | | // label点击事件 |
| | | labelClick(currentLabel, e) { |
| | | console.log("触发点击事件") |
| | | const id = e.target.options.id; |
| | | currentLabelStyleChange(currentLabel); |
| | | getReverseGeocode(e).then((addr) => { |
| | | this.currentLabelStyleChange(currentLabel); |
| | | this.getReverseGeocode(e).then((addr) => { |
| | | this.$emit( |
| | | "labelClick", |
| | | id |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | beforeUnmount() { |
| | | this.map = null; |
| | | }, |
| | | beforeDestroy() { |
| | | this.map = null; |
| | | } |
| | | }; |
| | | |
| | | // const emits = defineEmits<{ |