Skip to content

Commit

Permalink
Update ClusteredMapView.js
Browse files Browse the repository at this point in the history
Fix for 'region' undefined in '_onRegionChangeComplete'
  • Loading branch information
romain-spielmann authored and venits committed Jan 3, 2021
1 parent 3d6be0c commit 420a8df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ClusteredMapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const ClusteredMapView = forwardRef(
}, [isSpiderfier, markers]);

const _onRegionChangeComplete = (region) => {
if (superCluster) {
if (superCluster && region) {
const bBox = calculateBBox(region);
const zoom = returnMapZoom(region, bBox, minZoom);
const markers = superCluster.getClusters(bBox, zoom);
Expand Down

0 comments on commit 420a8df

Please sign in to comment.