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

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

上级 ee06986d
......@@ -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 {
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册