googlemaps / googlemaps/js-markerclusterer

Allow to return arbitrary `OverlayView` from the `MarkerClusterer.renderer.render`

Open
#1,135 0 comments 0 reactions 0 assignees View on GitHub
triage me type: feature request
Dominant language
TypeScript
Stars
293
Forks
104
Avg merge
3m
Merged PRs (30d)
18

Description

The `Renderer` interface is declared as:

```ts
export interface Renderer {
/**
* Turn a {@link Cluster} into a `Marker`.
*
* Below is a simple example to create a marker with the number of markers in the cluster as a label.
*
* ```typescript
* return new google.maps.Marker({
* position,
* label: String(markers.length),
* });
* ```
*/
render(cluster: Cluster, stats: ClusterStats, map: google.maps.Map): Marker;
}
```

Please add the ability to return arbitrary `OverlayView` from the `render` function. The `Marker` type that `render` currently expects is deprecated. The `render` function [needs to be updated to support the `AdvancedMarkerElement`](https://github.com/googlemaps/js-markerclusterer/issues/913), but it should also support arbitrary `OverlayView` as well.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.