单击标记时,angular2 infoWindow隐藏 [英] angular2 infoWindow hides when clicked on marker

查看:53
本文介绍了单击标记时,angular2 infoWindow隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个自定义标记,现在它认为如果单击该标记,就会提及mapmap:这是一个 PLUNKER

I have created a custom marker and now it thinks that if I click on the marker it is mentioned als mapClick: here a PLUNKER

mapClicked($event: MouseEvent) {
    this.isClicked = false;

    console.log(this.isClicked);

    if(this.lastClicked) {
        this.lastClicked.close();
        // this.lastClicked = null;
    }
}

有人知道解决方法吗?

推荐答案

在google-map-types.ts => google.maps的addDomListener中添加 event.stopPopagation().event.addDomListener(div,"click",function(event:any){google.maps.event.trigger(self.overlayView,"click");event.stopPropagation();});

add an event.stopPopagation() in the addDomListener in google-map-types.ts => google.maps.event.addDomListener(div, "click", function(event: any) { google.maps.event.trigger(self.overlayView, "click"); event.stopPropagation(); });

这篇关于单击标记时,angular2 infoWindow隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆