Google Maps Api V3: click event firing twice

前端 未结 5 1306
鱼传尺愫
鱼传尺愫 2021-01-14 05:43

I am following the MVCObject binding example from this page:

http://code.google.com/apis/maps/articles/mvcfun.html

I want to change the color of the circle a

5条回答
  •  独厮守ぢ
    2021-01-14 06:01

    This works for me:

    google.maps.event.addListener(circle, 'click', function (e) {
        clearTimeout(this.doNotTriggerTwiceTimeout);
        this.doNotTriggerTwiceTimeout = setTimeout(function(){
            alert('circle clicked');
        }, 100);
    });
    

提交回复
热议问题