Skip to content

feat(DefaultRenderer): custom color #870

Open
@rbalet

Description

@rbalet

Is your feature request related to a problem? Please describe.
To avoid having the recreate the renderer just to be ab le to change the color, letting user change those color while instantiating the class would be useful

Describe the solution you'd like
Add two color variable that can be set through class instantiation.

Additional context
The Idea

export class DefaultRenderer implements Renderer {
  underMeanColor: string
  overMeanColor: string

   constructor(underMeanColor = '#0000ff', overMeanColor = '#ff0000') {
     this.underMeanColor = underMeanColor
     this.overMeanColor = overMeanColor
     super() 
  } 
  
    public render( { count, position }: Cluster, stats: ClusterStats, map: google.maps.Map): Marker {
    // change color if this cluster has more markers than the mean cluster
    const color =
      count > Math.max(10, stats.clusters.markers.mean) ? this.overMeanColor : this.underMeanColor;
   
   // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions