Skip to content

Commit

Permalink
googlemaps#635 - Background color configuration for the cluster marker
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Korotkov committed Mar 13, 2020
1 parent 5d5430f commit 68e2431
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/markerclustererplus/src/cluster-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ export interface ClusterIconStyle {
* @default `"0 0"`
*/
backgroundPosition?: string;
/**
* The background color for the cluster marker
*
* @default `"#00A2D3"`
*/
backgroundColor?: string;
}

/**
Expand Down Expand Up @@ -437,6 +443,8 @@ export class ClusterIcon extends OverlayViewSafe {
left: coercePixels(pos.x),
width: coercePixels(this.style.width),
height: coercePixels(this.style.height),
'background-color': this.style.backgroundColor,
'--background-color': this.style.backgroundColor,
cursor: "pointer",
position: "absolute",
"-webkit-user-select": "none",
Expand Down
1 change: 1 addition & 0 deletions packages/markerclustererplus/src/markerclusterer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ export class MarkerClusterer extends OverlayViewSafe {
fontStyle: "normal",
fontFamily: "Arial,sans-serif",
backgroundPosition: "0 0",
backgroundColor: "#00A2D3",
...overrides
};
}
Expand Down

0 comments on commit 68e2431

Please sign in to comment.