Google Maps Api V3: click event firing twice

前端 未结 5 1283
鱼传尺愫
鱼传尺愫 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:05

    I had a similar problem. Could it be a bug in maps API v3? I do not have an answer but a workaround:

    google.maps.event.addListener(circle, 'click', function(event) {       
        if (event.alreadyCalled_) {
            alert('circle clicked again'); 
        }
        else {
            alert('circle clicked first time');      
            event.alreadyCalled_ = true;
        }
    }); 
    

    The click is still triggered twice but you can detect it.

提交回复
热议问题