googlemaps / googlemaps/js-markerclusterer

Markers disappears when zooming out in GridAlgorithm

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: bug
Dominant language
TypeScript
Stars
293
Forks
104
Avg merge
3m
Merged PRs (30d)
18

Description

When zooming out around when you can see two continents, the markers disapperas for the three algorithms GridAlgorithm, KmeansAlgorithm and DBScanAlgorithm. This can easily be seen in the algorithm demo.

#### Environment details

1. Replicate-able in both Windows/Linux and Chrome/FireFox
2. Version v1.0.16

#### Steps to reproduce

1. Go to https://googlemaps.github.io/js-markerclusterer/public/algorithms/
2. Zoom out until you see two continents
3. The markers/clusters disappear in 3 of 5 algorithms.

#### Code example
The problem seem to be in this function, when extending the bounds, new bounds gets wrong.
```
filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, viewportPadding)

var extendedMapBounds = extendBoundsToPaddedViewport(map.getBounds(), mapCanvasProjection, viewportPadding);
```

A quick and dirty workaround is to just not extend the bounds:
```
var extendedMapBounds = map.getBounds();
```

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.