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 +55 -36
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +55 -36
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/dist/index.modern.js
CHANGED
|
@@ -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$
|
|
516
|
+
var _directionRef$current3;
|
|
510
517
|
|
|
511
|
-
(_directionRef$
|
|
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$
|
|
522
|
+
var _directionRef$current4;
|
|
516
523
|
|
|
517
|
-
(_directionRef$
|
|
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$
|
|
530
|
+
var _directionRef$current5;
|
|
523
531
|
|
|
524
|
-
(_directionRef$
|
|
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$
|
|
537
|
+
var _directionRef$current6;
|
|
529
538
|
|
|
530
|
-
routes != undefined && ((_directionRef$
|
|
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$
|
|
542
|
+
var _directionRef$current7;
|
|
534
543
|
|
|
535
|
-
activedIndex != undefined && ((_directionRef$
|
|
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$
|
|
547
|
+
var _directionRef$current8;
|
|
539
548
|
|
|
540
|
-
activeStrokePattern != undefined && ((_directionRef$
|
|
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$
|
|
552
|
+
var _directionRef$current9;
|
|
544
553
|
|
|
545
|
-
inactiveStrokePattern != undefined && ((_directionRef$
|
|
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$
|
|
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$
|
|
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$
|
|
1691
|
+
var _polygonRef$current6;
|
|
1680
1692
|
|
|
1681
|
-
(
|
|
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$
|
|
1703
|
+
var _polygonRef$current7;
|
|
1685
1704
|
|
|
1686
|
-
fillColor != undefined && ((_polygonRef$
|
|
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$
|
|
1708
|
+
var _polygonRef$current8;
|
|
1690
1709
|
|
|
1691
|
-
fillOpacity != undefined && ((_polygonRef$
|
|
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$
|
|
1713
|
+
var _polygonRef$current9;
|
|
1695
1714
|
|
|
1696
|
-
(_polygonRef$
|
|
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$
|
|
1718
|
+
var _polygonRef$current10;
|
|
1700
1719
|
|
|
1701
|
-
strokeColor != undefined && ((_polygonRef$
|
|
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$
|
|
1723
|
+
var _polygonRef$current11;
|
|
1705
1724
|
|
|
1706
|
-
strokeWidth != undefined && ((_polygonRef$
|
|
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$
|
|
1728
|
+
var _polygonRef$current12;
|
|
1710
1729
|
|
|
1711
|
-
draggable != undefined && ((_polygonRef$
|
|
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$
|
|
1733
|
+
var _polygonRef$current13;
|
|
1715
1734
|
|
|
1716
|
-
elevation != undefined && ((_polygonRef$
|
|
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$
|
|
1738
|
+
var _polygonRef$current14;
|
|
1720
1739
|
|
|
1721
|
-
zIndex != undefined && ((_polygonRef$
|
|
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$
|
|
1743
|
+
var _polygonRef$current15;
|
|
1725
1744
|
|
|
1726
|
-
userInteractionEnabled != undefined && ((_polygonRef$
|
|
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
|
};
|