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 and toggle the visibility of the markers when the user clicks on the circle, so I add the listener into the RadiusWidget
constructor as follows:
function RadiusWidget() {
var circle = new google.maps.Circle({
strokeWeight: 2
});
this.set('distance', 50);
this.bindTo('bounds', circle);
circle.bindTo('center', this);
circle.bindTo('map', this);
circle.bindTo('radius', this);
this.addSizer_();
google.maps.event.addListener(circle, 'click', function()
{
alert('circle clicked');
});
}
My problem is that the click event is firing TWICE. Does anyone know why?
map
itself and then passed on to thecircle
object too – nemesisfixx Jun 27 '11 at 8:13