Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
fix: clustering map bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
hanmuk-oh committed Sep 2, 2021
1 parent 84d7ef8 commit 1df6731
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/markerclusterer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1098,17 +1098,10 @@ export class MarkerClusterer extends OverlayViewSafe {
// See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:
let mapBounds: google.maps.LatLngBounds;

if (this.getMap().getZoom() > 3) {
mapBounds = new google.maps.LatLngBounds(
(this.getMap() as google.maps.Map).getBounds().getSouthWest(),
(this.getMap() as google.maps.Map).getBounds().getNorthEast()
);
} else {
mapBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(85.02070771743472, -178.48388434375),
new google.maps.LatLng(-85.08136444384544, 178.00048865625)
);
}
mapBounds = new google.maps.LatLngBounds(
(this.getMap() as google.maps.Map).getBounds().getSouthWest(),
(this.getMap() as google.maps.Map).getBounds().getNorthEast()
);
const bounds = this.getExtendedBounds(mapBounds);

const iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);
Expand Down

0 comments on commit 1df6731

Please sign in to comment.