【问题标题】:angular2 infoWindow hides when clicked on marker单击标记时,angular2 infoWindow 隐藏
【发布时间】:2016-10-06 03:02:52
【问题描述】:

我已经创建了一个自定义标记,现在它认为如果我单击标记,它会被提及 als mapClick: here a PLUNKER

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

    console.log(this.isClicked);

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

有人知道解决方法吗?

【问题讨论】:

    标签: typescript angular


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-05
      • 2020-11-13
      • 2015-09-10
      • 2020-04-07
      相关资源
      最近更新 更多