react-map4d-map 1.3.0 → 1.3.2-tesst

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
@@ -486,6 +486,13 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
486
486
  directionRef.current.onMouseMove = onMouseMove;
487
487
  onCreated && onCreated(directionRef.current);
488
488
  }
489
+
490
+ return function () {
491
+ var _directionRef$current2;
492
+
493
+ (_directionRef$current2 = directionRef.current) === null || _directionRef$current2 === void 0 ? void 0 : _directionRef$current2.setMap(null);
494
+ console.log("remove when chang map");
495
+ };
489
496
  }, [theMap]);
490
497
  React.useEffect(function () {
491
498
  if (directionRef.current) {
@@ -509,46 +516,48 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
509
516
  }, [onMouseMove]);
510
517
  React.useEffect(function () {
511
518
  if (theMap) {
512
- var _directionRef$current2;
519
+ var _directionRef$current3;
513
520
 
514
- (_directionRef$current2 = directionRef.current) === null || _directionRef$current2 === void 0 ? void 0 : _directionRef$current2.setMap(theMap);
521
+ (_directionRef$current3 = directionRef.current) === null || _directionRef$current3 === void 0 ? void 0 : _directionRef$current3.setMap(theMap);
515
522
  }
516
523
 
517
524
  return function () {
518
- var _directionRef$current3;
525
+ var _directionRef$current4;
519
526
 
520
- (_directionRef$current3 = directionRef.current) === null || _directionRef$current3 === void 0 ? void 0 : _directionRef$current3.setMap(null);
527
+ (_directionRef$current4 = directionRef.current) === null || _directionRef$current4 === void 0 ? void 0 : _directionRef$current4.setMap(null);
528
+ console.log("remove when chang map");
521
529
  };
522
530
  }, [theMap]);
523
531
  React.useEffect(function () {
524
532
  return function () {
525
- var _directionRef$current4;
533
+ var _directionRef$current5;
526
534
 
527
- (_directionRef$current4 = directionRef.current) === null || _directionRef$current4 === void 0 ? void 0 : _directionRef$current4.setMap(null);
535
+ (_directionRef$current5 = directionRef.current) === null || _directionRef$current5 === void 0 ? void 0 : _directionRef$current5.setMap(null);
536
+ console.log("remove when unmount");
528
537
  };
529
538
  }, []);
530
539
  React.useEffect(function () {
531
- var _directionRef$current5;
540
+ var _directionRef$current6;
532
541
 
533
- routes != undefined && ((_directionRef$current5 = directionRef.current) === null || _directionRef$current5 === void 0 ? void 0 : _directionRef$current5.setRoutes(routes));
542
+ routes != undefined && ((_directionRef$current6 = directionRef.current) === null || _directionRef$current6 === void 0 ? void 0 : _directionRef$current6.setRoutes(routes));
534
543
  }, [routes]);
535
544
  React.useEffect(function () {
536
- var _directionRef$current6;
545
+ var _directionRef$current7;
537
546
 
538
- activedIndex != undefined && ((_directionRef$current6 = directionRef.current) === null || _directionRef$current6 === void 0 ? void 0 : _directionRef$current6.setActivedIndex(activedIndex));
547
+ activedIndex != undefined && ((_directionRef$current7 = directionRef.current) === null || _directionRef$current7 === void 0 ? void 0 : _directionRef$current7.setActivedIndex(activedIndex));
539
548
  }, [activedIndex]);
540
549
  React.useEffect(function () {
541
- var _directionRef$current7;
550
+ var _directionRef$current8;
542
551
 
543
- activeStrokePattern != undefined && ((_directionRef$current7 = directionRef.current) === null || _directionRef$current7 === void 0 ? void 0 : _directionRef$current7.setActiveStrokePattern(activeStrokePattern));
552
+ activeStrokePattern != undefined && ((_directionRef$current8 = directionRef.current) === null || _directionRef$current8 === void 0 ? void 0 : _directionRef$current8.setActiveStrokePattern(activeStrokePattern));
544
553
  }, [activeStrokePattern]);
545
554
  React.useEffect(function () {
546
- var _directionRef$current8;
555
+ var _directionRef$current9;
547
556
 
548
- inactiveStrokePattern != undefined && ((_directionRef$current8 = directionRef.current) === null || _directionRef$current8 === void 0 ? void 0 : _directionRef$current8.setInactiveStrokePattern(inactiveStrokePattern));
557
+ inactiveStrokePattern != undefined && ((_directionRef$current9 = directionRef.current) === null || _directionRef$current9 === void 0 ? void 0 : _directionRef$current9.setInactiveStrokePattern(inactiveStrokePattern));
549
558
  }, [inactiveStrokePattern]);
550
559
  React.useEffect(function () {
551
- var _directionRef$current9;
560
+ var _directionRef$current10;
552
561
 
553
562
  var option = {
554
563
  routes: routes,
@@ -573,7 +582,7 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
573
582
  delete option[key];
574
583
  }
575
584
  });
576
- (_directionRef$current9 = directionRef.current) === null || _directionRef$current9 === void 0 ? void 0 : _directionRef$current9.setOptions(option);
585
+ (_directionRef$current10 = directionRef.current) === null || _directionRef$current10 === void 0 ? void 0 : _directionRef$current10.setOptions(option);
577
586
  }, [activeStrokeWidth, activeStrokeColor, activeOutlineWidth, activeOutlineColor, inactiveStrokeColor, inactiveOutlineWidth, inactiveOutlineColor, originMarkerOptions, destinationMarkerOptions, waypointMarkerOptions, onMarkerDragEnd]);
578
587
  return null;
579
588
  };
@@ -1626,6 +1635,7 @@ var MFPolygon = function MFPolygon(props) {
1626
1635
  var map4dContext = React.useContext(Map4dContext);
1627
1636
  var theMap = map || map4dContext.map;
1628
1637
  var polygonRef = React.useRef();
1638
+ var a = React.useRef();
1629
1639
  React.useEffect(function () {
1630
1640
  if (theMap && !polygonRef.current) {
1631
1641
  var _polygonRef$current;
@@ -1648,6 +1658,8 @@ var MFPolygon = function MFPolygon(props) {
1648
1658
  }
1649
1659
  });
1650
1660
  polygonRef.current = new map4d.Polygon(option);
1661
+ a.current = theMap;
1662
+ console.log(a.current);
1651
1663
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1652
1664
  polygonRef.current.onHover = props.onHover;
1653
1665
  onCreated && onCreated(polygonRef.current);
@@ -1679,54 +1691,61 @@ var MFPolygon = function MFPolygon(props) {
1679
1691
  }
1680
1692
  }, [onHover]);
1681
1693
  React.useEffect(function () {
1682
- var _polygonRef$current5;
1694
+ var _polygonRef$current6;
1683
1695
 
1684
- (_polygonRef$current5 = polygonRef.current) === null || _polygonRef$current5 === void 0 ? void 0 : _polygonRef$current5.setPaths(paths);
1696
+ if (polygonRef.current) {
1697
+ var _polygonRef$current5;
1698
+
1699
+ var c = (_polygonRef$current5 = polygonRef.current) === null || _polygonRef$current5 === void 0 ? void 0 : _polygonRef$current5.getMap();
1700
+ console.log(c == a.current);
1701
+ }
1702
+
1703
+ (_polygonRef$current6 = polygonRef.current) === null || _polygonRef$current6 === void 0 ? void 0 : _polygonRef$current6.setPaths(paths);
1685
1704
  }, [paths]);
1686
1705
  React.useEffect(function () {
1687
- var _polygonRef$current6;
1706
+ var _polygonRef$current7;
1688
1707
 
1689
- fillColor != undefined && ((_polygonRef$current6 = polygonRef.current) === null || _polygonRef$current6 === void 0 ? void 0 : _polygonRef$current6.setFillColor(fillColor));
1708
+ fillColor != undefined && ((_polygonRef$current7 = polygonRef.current) === null || _polygonRef$current7 === void 0 ? void 0 : _polygonRef$current7.setFillColor(fillColor));
1690
1709
  }, [fillColor]);
1691
1710
  React.useEffect(function () {
1692
- var _polygonRef$current7;
1711
+ var _polygonRef$current8;
1693
1712
 
1694
- fillOpacity != undefined && ((_polygonRef$current7 = polygonRef.current) === null || _polygonRef$current7 === void 0 ? void 0 : _polygonRef$current7.setFillOpacity(fillOpacity));
1713
+ fillOpacity != undefined && ((_polygonRef$current8 = polygonRef.current) === null || _polygonRef$current8 === void 0 ? void 0 : _polygonRef$current8.setFillOpacity(fillOpacity));
1695
1714
  }, [fillOpacity]);
1696
1715
  React.useEffect(function () {
1697
- var _polygonRef$current8;
1716
+ var _polygonRef$current9;
1698
1717
 
1699
- (_polygonRef$current8 = polygonRef.current) === null || _polygonRef$current8 === void 0 ? void 0 : _polygonRef$current8.setVisible(visible);
1718
+ (_polygonRef$current9 = polygonRef.current) === null || _polygonRef$current9 === void 0 ? void 0 : _polygonRef$current9.setVisible(visible);
1700
1719
  }, [visible]);
1701
1720
  React.useEffect(function () {
1702
- var _polygonRef$current9;
1721
+ var _polygonRef$current10;
1703
1722
 
1704
- strokeColor != undefined && ((_polygonRef$current9 = polygonRef.current) === null || _polygonRef$current9 === void 0 ? void 0 : _polygonRef$current9.setStrokeColor(strokeColor));
1723
+ strokeColor != undefined && ((_polygonRef$current10 = polygonRef.current) === null || _polygonRef$current10 === void 0 ? void 0 : _polygonRef$current10.setStrokeColor(strokeColor));
1705
1724
  }, [strokeColor]);
1706
1725
  React.useEffect(function () {
1707
- var _polygonRef$current10;
1726
+ var _polygonRef$current11;
1708
1727
 
1709
- strokeWidth != undefined && ((_polygonRef$current10 = polygonRef.current) === null || _polygonRef$current10 === void 0 ? void 0 : _polygonRef$current10.setStrokeWidth(strokeWidth));
1728
+ strokeWidth != undefined && ((_polygonRef$current11 = polygonRef.current) === null || _polygonRef$current11 === void 0 ? void 0 : _polygonRef$current11.setStrokeWidth(strokeWidth));
1710
1729
  }, [strokeWidth]);
1711
1730
  React.useEffect(function () {
1712
- var _polygonRef$current11;
1731
+ var _polygonRef$current12;
1713
1732
 
1714
- draggable != undefined && ((_polygonRef$current11 = polygonRef.current) === null || _polygonRef$current11 === void 0 ? void 0 : _polygonRef$current11.setDraggable(draggable));
1733
+ draggable != undefined && ((_polygonRef$current12 = polygonRef.current) === null || _polygonRef$current12 === void 0 ? void 0 : _polygonRef$current12.setDraggable(draggable));
1715
1734
  }, [draggable]);
1716
1735
  React.useEffect(function () {
1717
- var _polygonRef$current12;
1736
+ var _polygonRef$current13;
1718
1737
 
1719
- elevation != undefined && ((_polygonRef$current12 = polygonRef.current) === null || _polygonRef$current12 === void 0 ? void 0 : _polygonRef$current12.setElevation(elevation));
1738
+ elevation != undefined && ((_polygonRef$current13 = polygonRef.current) === null || _polygonRef$current13 === void 0 ? void 0 : _polygonRef$current13.setElevation(elevation));
1720
1739
  }, [elevation]);
1721
1740
  React.useEffect(function () {
1722
- var _polygonRef$current13;
1741
+ var _polygonRef$current14;
1723
1742
 
1724
- zIndex != undefined && ((_polygonRef$current13 = polygonRef.current) === null || _polygonRef$current13 === void 0 ? void 0 : _polygonRef$current13.setZIndex(zIndex));
1743
+ zIndex != undefined && ((_polygonRef$current14 = polygonRef.current) === null || _polygonRef$current14 === void 0 ? void 0 : _polygonRef$current14.setZIndex(zIndex));
1725
1744
  }, [zIndex]);
1726
1745
  React.useEffect(function () {
1727
- var _polygonRef$current14;
1746
+ var _polygonRef$current15;
1728
1747
 
1729
- userInteractionEnabled != undefined && ((_polygonRef$current14 = polygonRef.current) === null || _polygonRef$current14 === void 0 ? void 0 : _polygonRef$current14.setUserInteraction(userInteractionEnabled));
1748
+ userInteractionEnabled != undefined && ((_polygonRef$current15 = polygonRef.current) === null || _polygonRef$current15 === void 0 ? void 0 : _polygonRef$current15.setUserInteraction(userInteractionEnabled));
1730
1749
  }, [userInteractionEnabled]);
1731
1750
  return null;
1732
1751
  };