googlemaps / googlemaps/js-markerclusterer

Use a Set of markers instead of an array

Open
#627 1 comment 0 reactions 1 assignee Claimed by @amuramoto View on GitHub
triage me type: feature request
Dominant language
TypeScript
Stars
293
Forks
104
Avg merge
3m
Merged PRs (30d)
18

Description

The clusterer uses an array of markers:

https://github.com/googlemaps/js-markerclusterer/blob/9476b3a62399fd124c92ed74faae6943cf573ea4/src/markerclusterer.ts#L33

This is inefficient has the lib often scans the whole list (and by definition the list is big when you use the clusterer):

https://github.com/googlemaps/js-markerclusterer/blob/9476b3a62399fd124c92ed74faae6943cf573ea4/src/markerclusterer.ts#L104-L106

https://github.com/googlemaps/js-markerclusterer/blob/9476b3a62399fd124c92ed74faae6943cf573ea4/src/markerclusterer.ts#L125

switching to a `Set` would be much more efficient.

I could volunteer that code if using a `Set` is ok with the targeted list of supported browsers - let me know

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.