Skip to content

Commit

Permalink
Add textColor Option
Browse files Browse the repository at this point in the history
  • Loading branch information
Montri Weravattana committed Jun 29, 2021
1 parent c439b96 commit ce4d06a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/longdomap.markercluster-src.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/longdomap.markercluster-src.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ConfigHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default class {
constructor(options){
this.maxZoom = options.maxZoom || null;
this.minClusterSize = options.minClusterSize || 2;
this.textColor = options.textColor || 'black';
this.gridSize = options.gridSize || 120;
this.clusterRadius = options.clusterRadius || this.gridSize;
this.averageCenter = options.averageCenter;
Expand Down
3 changes: 2 additions & 1 deletion src/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export class IconLoader{
elm.style.marginLeft = '-22px';
elm.style.marginTop = '-22px';
elm.style.overflow = 'hidden';
elm.style.color = `${this._config.textColor}`
elm.className = 'marker-cluster marker-cluster-small leaflet-marker-icon';
result.html = elm.outerHTML;
result.size = {"width":44,"height":44};
Expand All @@ -257,7 +258,7 @@ export class IconLoader{
elm.style.marginTop = `-${img.height/2}px`;
elm.style.background = `url('${encodeURI(img.src)}') no-repeat center top`;
elm.style.lineHeight = elm.style.height;
elm.style.color = 'black';
elm.style.color = `${this._config.textColor}`;
elm.style.fontWeight = 'bold';
elm.style.textAlign = 'center';
result.html = elm.outerHTML;
Expand Down

0 comments on commit ce4d06a

Please sign in to comment.