提交 9c469e4d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(map): 修复高德地图 callout 点击触发 map 点击

上级 ee06986d
...@@ -274,12 +274,13 @@ export default { ...@@ -274,12 +274,13 @@ export default {
callout.setOption(calloutStyle) callout.setOption(calloutStyle)
} else { } else {
if (IS_AMAP) { if (IS_AMAP) {
const callback = (self) => { const callback = ($event, self) => {
if (self.idString) { if (self.idString) {
self.$parent.$trigger('callouttap', {}, { self.$parent.$trigger('callouttap', $event, {
markerId: Number(self.idString) markerId: Number(self.idString)
}) })
} }
$event.stopPropagation()
} }
callout = marker.callout = new maps.Callout(calloutStyle, callback, this) callout = marker.callout = new maps.Callout(calloutStyle, callback, this)
} else { } else {
......
...@@ -34,8 +34,8 @@ export function createCallout (maps) { ...@@ -34,8 +34,8 @@ export function createCallout (maps) {
position: option.position position: option.position
}) })
maps.event.addListener(this.Text, 'click', () => { maps.event.addListener(this.Text, 'click', ({ originEvent }) => {
this.callback(this.parent) this.callback(originEvent, this.parent)
}) })
this.Text.setMap(option.map) this.Text.setMap(option.map)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册