From 9c469e4da866811aba24fd69f32f6e9e12be8efa Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 10 Aug 2022 16:46:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(map):=20=E4=BF=AE=E5=A4=8D=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=9C=B0=E5=9B=BE=20callout=20=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=20map=20=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/h5/view/components/map/map-marker.js | 5 +++-- src/platforms/h5/view/components/map/maps/callout.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/platforms/h5/view/components/map/map-marker.js b/src/platforms/h5/view/components/map/map-marker.js index 34b27d946..b2a11f3ec 100644 --- a/src/platforms/h5/view/components/map/map-marker.js +++ b/src/platforms/h5/view/components/map/map-marker.js @@ -274,12 +274,13 @@ export default { callout.setOption(calloutStyle) } else { if (IS_AMAP) { - const callback = (self) => { + const callback = ($event, self) => { if (self.idString) { - self.$parent.$trigger('callouttap', {}, { + self.$parent.$trigger('callouttap', $event, { markerId: Number(self.idString) }) } + $event.stopPropagation() } callout = marker.callout = new maps.Callout(calloutStyle, callback, this) } else { diff --git a/src/platforms/h5/view/components/map/maps/callout.js b/src/platforms/h5/view/components/map/maps/callout.js index e9037b608..f0e893f49 100644 --- a/src/platforms/h5/view/components/map/maps/callout.js +++ b/src/platforms/h5/view/components/map/maps/callout.js @@ -34,8 +34,8 @@ export function createCallout (maps) { position: option.position }) - maps.event.addListener(this.Text, 'click', () => { - this.callback(this.parent) + maps.event.addListener(this.Text, 'click', ({ originEvent }) => { + this.callback(originEvent, this.parent) }) this.Text.setMap(option.map) -- GitLab