From a90bc850c98cac954233203461ed239d4fd5ecd8 Mon Sep 17 00:00:00 2001 From: Jordan Schroter Date: Tue, 14 Jun 2016 18:12:16 -0400 Subject: [PATCH 1/2] allow imagePath to be a function, useful for cache busting --- CONTRIBUTORS | 1 + src/markerclusterer.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index aa5a6d9..445b38d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -14,3 +14,4 @@ Brendan Kenny Moisés Arcos Peter Grassberger Chris Fritz +Jordan Schroter diff --git a/src/markerclusterer.js b/src/markerclusterer.js index 554fcec..c471edd 100755 --- a/src/markerclusterer.js +++ b/src/markerclusterer.js @@ -245,8 +245,16 @@ MarkerClusterer.prototype.setupStyles_ = function() { } for (var i = 0, size; size = this.sizes[i]; i++) { + var url = '' + + if (typeof this.imagePath_ === 'function') { + url = this.imagePath_(i, size) + } else { + url = this.imagePath_ + (i + 1) + '.' + this.imageExtension_ + } + this.styles_.push({ - url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_, + url: url, height: size, width: size }); From 88332028f767286cda7fb9509c28b0f1d38fb980 Mon Sep 17 00:00:00 2001 From: Jordan Schroter Date: Wed, 15 Jun 2016 10:46:56 -0400 Subject: [PATCH 2/2] fixed formatting --- src/markerclusterer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/markerclusterer.js b/src/markerclusterer.js index c471edd..49cfe3d 100755 --- a/src/markerclusterer.js +++ b/src/markerclusterer.js @@ -245,12 +245,12 @@ MarkerClusterer.prototype.setupStyles_ = function() { } for (var i = 0, size; size = this.sizes[i]; i++) { - var url = '' + var url = ''; if (typeof this.imagePath_ === 'function') { - url = this.imagePath_(i, size) + url = this.imagePath_(i, size); } else { - url = this.imagePath_ + (i + 1) + '.' + this.imageExtension_ + url = this.imagePath_ + (i + 1) + '.' + this.imageExtension_; } this.styles_.push({