react-map4d-map 1.3.7 → 1.3.8

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/index.js CHANGED
@@ -1359,7 +1359,7 @@ var MFMarkerCluster = function MFMarkerCluster(props) {
1359
1359
  (_markerClusterRef$cur = markerClusterRef.current) === null || _markerClusterRef$cur === void 0 ? void 0 : _markerClusterRef$cur.setMap(null);
1360
1360
 
1361
1361
  if (theMap) {
1362
- var _markerClusterRef$cur2;
1362
+ var _markerRefs$current;
1363
1363
 
1364
1364
  var option = {
1365
1365
  minZoom: minZoom,
@@ -1372,9 +1372,14 @@ var MFMarkerCluster = function MFMarkerCluster(props) {
1372
1372
  delete option[key];
1373
1373
  }
1374
1374
  });
1375
- markerClusterRef.current = new map4d.MarkerClusterer(markerRefs.current, option);
1376
- (_markerClusterRef$cur2 = markerClusterRef.current) === null || _markerClusterRef$cur2 === void 0 ? void 0 : _markerClusterRef$cur2.setMap(theMap);
1377
- onCreated && onCreated(markerClusterRef.current);
1375
+
1376
+ if (markerRefs.current && ((_markerRefs$current = markerRefs.current) === null || _markerRefs$current === void 0 ? void 0 : _markerRefs$current.length) > 0) {
1377
+ var _markerClusterRef$cur2;
1378
+
1379
+ markerClusterRef.current = new map4d.MarkerClusterer(markerRefs.current, option);
1380
+ (_markerClusterRef$cur2 = markerClusterRef.current) === null || _markerClusterRef$cur2 === void 0 ? void 0 : _markerClusterRef$cur2.setMap(theMap);
1381
+ onCreated && onCreated(markerClusterRef.current);
1382
+ }
1378
1383
  }
1379
1384
  };
1380
1385