Skip to content
This repository was archived by the owner on Jun 16, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Luke Mahé <[email protected]>
Brendan Kenny <[email protected]>
Moisés Arcos <[email protected]>
Peter Grassberger <[email protected]>
Chris Fritz <[email protected]>
12 changes: 11 additions & 1 deletion src/markerclusterer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,18 @@ ClusterIcon.prototype.onAdd = function() {
panes.overlayMouseTarget.appendChild(this.div_);

var that = this;
var isDragging = false;
google.maps.event.addDomListener(this.div_, 'click', function(event) {
that.triggerClusterClick(event);
// Only perform click when not preceded by a drag
if (!isDragging) {
that.triggerClusterClick(event);
}
});
google.maps.event.addDomListener(this.div_, 'mousedown', function() {
isDragging = false;
});
google.maps.event.addDomListener(this.div_, 'mousemove', function() {
isDragging = true;
});
};

Expand Down