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.
@@ -12,6 +12,7 @@ interface PolygonProps {
12
12
  map?: map4d.Map;
13
13
  onCreated?: (polygon: map4d.Polygon) => void;
14
14
  onHover?: (args: any) => void;
15
+ onClick?: (args: any) => void;
15
16
  }
16
17
  declare const MFPolygon: (props: PolygonProps) => null;
17
18
  export default MFPolygon;
package/dist/index.js CHANGED
@@ -1013,11 +1013,13 @@ var MFMap = function MFMap(props) {
1013
1013
  poi: true
1014
1014
  });
1015
1015
  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) {
1016
- var _args$circle, _args$circle2;
1016
+ var _args$circle, _args$circle2, _args$polygon3, _args$polygon3$onClic;
1017
1017
 
1018
1018
  ((_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));
1019
+ (_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);
1019
1020
  }, {
1020
- circle: true
1021
+ circle: true,
1022
+ polygon: true
1021
1023
  })]);
1022
1024
 
1023
1025
  if (props.onClickLocation) {
@@ -1650,6 +1652,7 @@ var MFPolygon = function MFPolygon(props) {
1650
1652
  userInteractionEnabled = props.userInteractionEnabled,
1651
1653
  map = props.map,
1652
1654
  onHover = props.onHover,
1655
+ onClick = props.onClick,
1653
1656
  onCreated = props.onCreated;
1654
1657
  var map4dContext = React.useContext(Map4dContext);
1655
1658
  var theMap = map || map4dContext.map;
@@ -1678,6 +1681,7 @@ var MFPolygon = function MFPolygon(props) {
1678
1681
  polygonRef.current = new map4d.Polygon(option);
1679
1682
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1680
1683
  polygonRef.current.onHover = props.onHover;
1684
+ polygonRef.current.onClick = onClick;
1681
1685
  onCreated && onCreated(polygonRef.current);
1682
1686
  }
1683
1687
  }, [theMap]);
@@ -1706,6 +1710,11 @@ var MFPolygon = function MFPolygon(props) {
1706
1710
  polygonRef.current.onHover = onHover;
1707
1711
  }
1708
1712
  }, [onHover]);
1713
+ React.useEffect(function () {
1714
+ if (polygonRef.current) {
1715
+ polygonRef.current.onClick = onClick;
1716
+ }
1717
+ }, [onClick]);
1709
1718
  React.useEffect(function () {
1710
1719
  var _polygonRef$current5;
1711
1720