Prevent event bubbling?

109 views
Skip to first unread message

Eric Jain

unread,
Feb 12, 2010, 2:35:56 PM2/12/10
to Google Maps JavaScript API v3
After registering e.g. a dblclick handler on a Rectangle, how do I
prevent that event from triggering another handler as well (e.g. map
zoom)?

google.maps.event.addListener(area, 'dblclick', function(event) {
// do something, but don't zoom in!
});

Marcelo

unread,
Feb 12, 2010, 6:21:45 PM2/12/10
to Google Maps JavaScript API v3
Events do not trigger one another, and the map doesn't zoom because
the polygon is there.
The mapOptions that you pass to the map constructor allow you to set
disableDoubleClickZoom to true or false.

--
Marcelo - http://maps.forum.nu
--

Susannah (Google Employee)

unread,
Feb 14, 2010, 10:44:59 PM2/14/10
to Google Maps JavaScript API v3
Hi Eric,

There is not currently a way to prevent the map from zooming when
double clicking on a poly except to disable it for the whole map.
Please file an issue in the issue tracker for this feature request.

http://code.google.com/p/gmaps-api-issues/issues/list?q=label:ApiType-Javascript3

Thanks,
Susannah

Eric Jain

unread,
Feb 15, 2010, 1:56:38 PM2/15/10
to Google Maps JavaScript API v3
On Feb 14, 7:44 pm, "Susannah (Google Employee)"

<susann...@google.com> wrote:
> Please file an issue in the issue tracker for this feature request.

http://code.google.com/p/gmaps-api-issues/issues/detail?id=2172

Reply all
Reply to author
Forward
0 new messages