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..49cfe3d 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 });