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