Skip to content

Commit 9c63368

Browse files
author
S M Asad Rahman
committed
feat: changing cluster image based on cluster buzzed & varified marker (sp to project)
1 parent 70a8d45 commit 9c63368

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/markerclusterer.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@ Cluster.prototype.addMarker = function(marker) {
859859

860860
marker.isAdded = true;
861861
this.markers_.push(marker);
862+
this.isVarified = this.isVarified || /verified/.test(marker.icon);
863+
this.isBuzzed = this.isBuzzed || /buzzed/.test(marker.icon);
864+
862865

863866
var len = this.markers_.length;
864867
if (len < this.minClusterSize_ && marker.getMap() != this.map_) {
@@ -1207,6 +1210,13 @@ ClusterIcon.prototype.useStyle = function() {
12071210
this.textSize_ = style['textSize'];
12081211
this.backgroundPosition_ = style['backgroundPosition'];
12091212
this.iconAnchor_ = style['iconAnchor'];
1213+
1214+
/* cluster url hack for verified cluster */
1215+
if(this.cluster_.isVarified) {
1216+
this.url_ = style['url'].replace(/balloon([0-9])/, 'verified-balloon$1');
1217+
} else if(this.cluster_.isBuzzed) { /* cluster url hack for buzzed cluster */
1218+
this.url_ = style['url'].replace(/balloon([0-9])/, 'buzzed-balloon$1');
1219+
}
12101220
};
12111221

12121222

0 commit comments

Comments
 (0)