Skip to content

Commit 3d1842e

Browse files
author
S M Asad Rahman
authored
enable cluster custom zindex setting
1 parent 7d5142d commit 3d1842e

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
@@ -1217,6 +1217,12 @@ ClusterIcon.prototype.useStyle = function() {
12171217
} else if(this.cluster_.isBuzzed) { /* cluster url hack for buzzed cluster */
12181218
this.url_ = style['url'].replace(/balloon\./, 'buzzed-balloon.');
12191219
}
1220+
1221+
/* Cluster zIndex hack */
1222+
if(style['zIndex']) {
1223+
this.zIndex_ = style['zIndex'];
1224+
}
1225+
12201226
};
12211227

12221228

@@ -1241,6 +1247,10 @@ ClusterIcon.prototype.createCss = function(pos) {
12411247
style.push('background-image:url(' + this.url_ + ');');
12421248
var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
12431249
style.push('background-position:' + backgroundPosition + ';');
1250+
1251+
if(this.zIndex_) {
1252+
style.push('z-index:' + this.zIndex_ + ';');
1253+
}
12441254

12451255
if (typeof this.anchor_ === 'object') {
12461256
if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 &&

0 commit comments

Comments
 (0)