react-map4d-map 1.2.1 → 1.2.2

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
@@ -443,6 +443,7 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
443
443
  waypointMarkerOptions = props.waypointMarkerOptions,
444
444
  onMarkerDragEnd = props.onMarkerDragEnd,
445
445
  map = props.map,
446
+ onHover = props.onHover,
446
447
  onCreated = props.onCreated;
447
448
  var map4dContext = React.useContext(Map4dContext);
448
449
  var theMap = map || map4dContext.map;
@@ -480,6 +481,11 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
480
481
  onCreated && onCreated(directionRef.current);
481
482
  }
482
483
  }, [theMap]);
484
+ React.useEffect(function () {
485
+ if (directionRef.current) {
486
+ directionRef.current.onHover = onHover;
487
+ }
488
+ }, [onHover]);
483
489
  React.useEffect(function () {
484
490
  if (theMap) {
485
491
  var _directionRef$current2;
@@ -956,7 +962,10 @@ var MFMarker = function MFMarker(props) {
956
962
  userInteractionEnabled = props.userInteractionEnabled,
957
963
  map = props.map,
958
964
  onCreated = props.onCreated,
959
- onClick = props.onClick;
965
+ onClick = props.onClick,
966
+ onRightClick = props.onRightClick,
967
+ onDragEnd = props.onDragEnd,
968
+ onHover = props.onHover;
960
969
  var map4dContext = React.useContext(Map4dContext);
961
970
  var markerClusterContext = React.useContext(MarkerClusterContext);
962
971
  var theMap = map || map4dContext.map;
@@ -1047,6 +1056,26 @@ var MFMarker = function MFMarker(props) {
1047
1056
  markerRef.current && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.removeMarker) && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.removeMarker(markerRef.current));
1048
1057
  };
1049
1058
  }, []);
1059
+ React.useEffect(function () {
1060
+ if (markerRef.current) {
1061
+ markerRef.current.onHover = onHover;
1062
+ }
1063
+ }, [onHover]);
1064
+ React.useEffect(function () {
1065
+ if (markerRef.current) {
1066
+ markerRef.current.onClick = onClick;
1067
+ }
1068
+ }, [onClick]);
1069
+ React.useEffect(function () {
1070
+ if (markerRef.current) {
1071
+ markerRef.current.onRightClick = onRightClick;
1072
+ }
1073
+ }, [onRightClick]);
1074
+ React.useEffect(function () {
1075
+ if (markerRef.current) {
1076
+ markerRef.current.onHover = onDragEnd;
1077
+ }
1078
+ }, [onDragEnd]);
1050
1079
  React.useEffect(function () {
1051
1080
  var _markerRef$current4;
1052
1081
 
@@ -1444,6 +1473,7 @@ var MFPolygon = function MFPolygon(props) {
1444
1473
  zIndex = props.zIndex,
1445
1474
  userInteractionEnabled = props.userInteractionEnabled,
1446
1475
  map = props.map,
1476
+ onHover = props.onHover,
1447
1477
  onCreated = props.onCreated;
1448
1478
  var map4dContext = React.useContext(Map4dContext);
1449
1479
  var theMap = map || map4dContext.map;
@@ -1495,6 +1525,11 @@ var MFPolygon = function MFPolygon(props) {
1495
1525
  (_polygonRef$current4 = polygonRef.current) === null || _polygonRef$current4 === void 0 ? void 0 : _polygonRef$current4.setMap(null);
1496
1526
  };
1497
1527
  }, []);
1528
+ React.useEffect(function () {
1529
+ if (polygonRef.current) {
1530
+ polygonRef.current.onHover = onHover;
1531
+ }
1532
+ }, [onHover]);
1498
1533
  React.useEffect(function () {
1499
1534
  var _polygonRef$current5;
1500
1535
 
@@ -1562,6 +1597,8 @@ var MFPolyline = function MFPolyline(props) {
1562
1597
  strokePattern = props.strokePattern,
1563
1598
  userInteractionEnabled = props.userInteractionEnabled,
1564
1599
  map = props.map,
1600
+ onClick = props.onClick,
1601
+ onHover = props.onHover,
1565
1602
  onCreated = props.onCreated;
1566
1603
  var map4dContext = React.useContext(Map4dContext);
1567
1604
  var theMap = map || map4dContext.map;
@@ -1618,6 +1655,16 @@ var MFPolyline = function MFPolyline(props) {
1618
1655
  (_polylineRef$current4 = polylineRef.current) === null || _polylineRef$current4 === void 0 ? void 0 : _polylineRef$current4.setMap(null);
1619
1656
  };
1620
1657
  }, []);
1658
+ React.useEffect(function () {
1659
+ if (polylineRef.current) {
1660
+ polylineRef.current.onHover = onHover;
1661
+ }
1662
+ }, [onHover]);
1663
+ React.useEffect(function () {
1664
+ if (polylineRef.current) {
1665
+ polylineRef.current.onClick = onClick;
1666
+ }
1667
+ }, [onClick]);
1621
1668
  React.useEffect(function () {
1622
1669
  var _polylineRef$current5;
1623
1670