react-map4d-map 1.3.6 → 1.3.7

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.
@@ -1010,11 +1010,13 @@ var MFMap = function MFMap(props) {
1010
1010
  poi: true
1011
1011
  });
1012
1012
  events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline, eventMouseOutDirection, eventMouseOverDirection, eventMouseMoveDirection, eventMouseOutPolyline, eventMouseOverPolyline, eventMouseMovePolyline, eventMouseOutMarker, eventMouseOverMarker, eventMouseMoveMarker, eventClickPoi, eventHoverPoi, (_mapRef$current21 = mapRef.current) === null || _mapRef$current21 === void 0 ? void 0 : _mapRef$current21.addListener("click", function (args) {
1013
- var _args$circle, _args$circle2;
1013
+ var _args$circle, _args$circle2, _args$polygon3, _args$polygon3$onClic;
1014
1014
 
1015
1015
  ((_args$circle = args.circle) === null || _args$circle === void 0 ? void 0 : _args$circle.onClick) && ((_args$circle2 = args.circle) === null || _args$circle2 === void 0 ? void 0 : _args$circle2.onClick(args));
1016
+ (_args$polygon3 = args.polygon) === null || _args$polygon3 === void 0 ? void 0 : (_args$polygon3$onClic = _args$polygon3.onClick) === null || _args$polygon3$onClic === void 0 ? void 0 : _args$polygon3$onClic.call(_args$polygon3, args);
1016
1017
  }, {
1017
- circle: true
1018
+ circle: true,
1019
+ polygon: true
1018
1020
  })]);
1019
1021
 
1020
1022
  if (props.onClickLocation) {
@@ -1647,6 +1649,7 @@ var MFPolygon = function MFPolygon(props) {
1647
1649
  userInteractionEnabled = props.userInteractionEnabled,
1648
1650
  map = props.map,
1649
1651
  onHover = props.onHover,
1652
+ onClick = props.onClick,
1650
1653
  onCreated = props.onCreated;
1651
1654
  var map4dContext = useContext(Map4dContext);
1652
1655
  var theMap = map || map4dContext.map;
@@ -1675,6 +1678,7 @@ var MFPolygon = function MFPolygon(props) {
1675
1678
  polygonRef.current = new map4d.Polygon(option);
1676
1679
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1677
1680
  polygonRef.current.onHover = props.onHover;
1681
+ polygonRef.current.onClick = onClick;
1678
1682
  onCreated && onCreated(polygonRef.current);
1679
1683
  }
1680
1684
  }, [theMap]);
@@ -1703,6 +1707,11 @@ var MFPolygon = function MFPolygon(props) {
1703
1707
  polygonRef.current.onHover = onHover;
1704
1708
  }
1705
1709
  }, [onHover]);
1710
+ useEffect(function () {
1711
+ if (polygonRef.current) {
1712
+ polygonRef.current.onClick = onClick;
1713
+ }
1714
+ }, [onClick]);
1706
1715
  useEffect(function () {
1707
1716
  var _polygonRef$current5;
1708
1717