Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Fixing the "clusterclick" firing event generation. #110

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion src/markerclusterer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ ClusterIcon.prototype.onAdd = function() {

var that = this;
var isDragging = false;
var isMouseDown = false;
google.maps.event.addDomListener(this.div_, 'click', function(event) {
// Only perform click when not preceded by a drag
if (!isDragging) {
Expand All @@ -1084,9 +1085,16 @@ ClusterIcon.prototype.onAdd = function() {
});
google.maps.event.addDomListener(this.div_, 'mousedown', function() {
isDragging = false;
isMouseDown = true;
});
google.maps.event.addDomListener(this.div_, 'mouseup', function() {
isDragging = false;
isMouseDown = false;
});
google.maps.event.addDomListener(this.div_, 'mousemove', function() {
isDragging = true;
if (isMouseDown) {
isDragging = true;
}
});
};

Expand Down