@banyan_cloud/roots 1.0.124 → 1.0.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -113574,15 +113574,16 @@ var BaseMap = function BaseMap(props) {
|
|
|
113574
113574
|
}));
|
|
113575
113575
|
}
|
|
113576
113576
|
}, [clustered, children, map]);
|
|
113577
|
+
var childCount = React.Children.count(children);
|
|
113577
113578
|
React.useEffect(function () {
|
|
113578
|
-
if (fitBounds && map &&
|
|
113579
|
+
if (fitBounds && map && childCount > 0) {
|
|
113579
113580
|
var bounds = new google.maps.LatLngBounds();
|
|
113580
113581
|
React.Children.forEach(children, function (child) {
|
|
113581
113582
|
bounds.extend(new google.maps.LatLng(child.props.position.lat, child.props.position.lng));
|
|
113582
113583
|
});
|
|
113583
113584
|
map.fitBounds(bounds);
|
|
113584
113585
|
}
|
|
113585
|
-
}, [fitBounds, map]);
|
|
113586
|
+
}, [fitBounds, map, childCount]);
|
|
113586
113587
|
useDeepCompareEffectForMaps(function () {
|
|
113587
113588
|
if (map) {
|
|
113588
113589
|
map.setOptions(options);
|