react-map4d-map 1.1.9 → 1.2.1

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.
@@ -473,6 +473,7 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
473
473
  });
474
474
  directionRef.current = new map4d.DirectionsRenderer(option);
475
475
  (_directionRef$current = directionRef.current) === null || _directionRef$current === void 0 ? void 0 : _directionRef$current.setMap(theMap);
476
+ directionRef.current.onHover = props.onHover;
476
477
  onCreated && onCreated(directionRef.current);
477
478
  }
478
479
  }, [theMap]);
@@ -808,7 +809,7 @@ var MFMap = function MFMap(props) {
808
809
  }, [props.environment, props.version, props.accessKey]);
809
810
 
810
811
  var registerEvent = function registerEvent() {
811
- var _mapRef$current2, _mapRef$current3, _mapRef$current4;
812
+ var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8, _mapRef$current9;
812
813
 
813
814
  var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
814
815
  var _args$marker, _args$marker2;
@@ -831,12 +832,47 @@ var MFMap = function MFMap(props) {
831
832
  }, {
832
833
  marker: true
833
834
  });
834
- events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker]);
835
+ var eventHoverMarker = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("hover", function (args) {
836
+ var _args$marker7, _args$marker8;
837
+
838
+ ((_args$marker7 = args.marker) === null || _args$marker7 === void 0 ? void 0 : _args$marker7.onHover) && ((_args$marker8 = args.marker) === null || _args$marker8 === void 0 ? void 0 : _args$marker8.onHover());
839
+ }, {
840
+ marker: true
841
+ });
842
+ var eventHoverPolygon = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("hover", function (args) {
843
+ var _args$polygon, _args$polygon2;
844
+
845
+ ((_args$polygon = args.polygon) === null || _args$polygon === void 0 ? void 0 : _args$polygon.onHover) && ((_args$polygon2 = args.polygon) === null || _args$polygon2 === void 0 ? void 0 : _args$polygon2.onHover());
846
+ }, {
847
+ polygon: true
848
+ });
849
+ var eventHoverPolyline = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("hover", function (args) {
850
+ var _args$polyline, _args$polyline2;
851
+
852
+ ((_args$polyline = args.polyline) === null || _args$polyline === void 0 ? void 0 : _args$polyline.onHover) && ((_args$polyline2 = args.polyline) === null || _args$polyline2 === void 0 ? void 0 : _args$polyline2.onHover());
853
+ }, {
854
+ polyline: true
855
+ });
856
+ var eventHoverDirection = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("hover", function (args) {
857
+ var _args$renderer, _args$renderer2;
858
+
859
+ ((_args$renderer = args.renderer) === null || _args$renderer === void 0 ? void 0 : _args$renderer.onHover) && ((_args$renderer2 = args.renderer) === null || _args$renderer2 === void 0 ? void 0 : _args$renderer2.onHover());
860
+ }, {
861
+ directions: true
862
+ });
863
+ var eventClickPolyline = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("click", function (args) {
864
+ var _args$polyline3, _args$polyline4;
865
+
866
+ ((_args$polyline3 = args.polyline) === null || _args$polyline3 === void 0 ? void 0 : _args$polyline3.onClick) && ((_args$polyline4 = args.polyline) === null || _args$polyline4 === void 0 ? void 0 : _args$polyline4.onClick());
867
+ }, {
868
+ polyline: true
869
+ });
870
+ events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline]);
835
871
 
836
872
  if (props.onClickLocation) {
837
- var _mapRef$current5;
873
+ var _mapRef$current10;
838
874
 
839
- var onClickLocation = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("click", function (args) {
875
+ var onClickLocation = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("click", function (args) {
840
876
  props.onClickLocation && props.onClickLocation(args);
841
877
  }, {
842
878
  location: true
@@ -845,9 +881,9 @@ var MFMap = function MFMap(props) {
845
881
  }
846
882
 
847
883
  if (props.onRightClickLocation) {
848
- var _mapRef$current6;
884
+ var _mapRef$current11;
849
885
 
850
- var onRightClickLocation = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("rightClick", function (args) {
886
+ var onRightClickLocation = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("rightClick", function (args) {
851
887
  props.onRightClickLocation && props.onRightClickLocation(args);
852
888
  }, {
853
889
  location: true
@@ -856,9 +892,9 @@ var MFMap = function MFMap(props) {
856
892
  }
857
893
 
858
894
  if (props.onTilesLoaded) {
859
- var _mapRef$current7;
895
+ var _mapRef$current12;
860
896
 
861
- var onTilesLoaded = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("tilesLoaded", function (args) {
897
+ var onTilesLoaded = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("tilesLoaded", function (args) {
862
898
  props.onTilesLoaded && props.onTilesLoaded(args);
863
899
  }, {
864
900
  location: true
@@ -867,9 +903,9 @@ var MFMap = function MFMap(props) {
867
903
  }
868
904
 
869
905
  if (props.onCameraChanging) {
870
- var _mapRef$current8;
906
+ var _mapRef$current13;
871
907
 
872
- var onCameraChanging = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("cameraChanging", function (args) {
908
+ var onCameraChanging = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("cameraChanging", function (args) {
873
909
  props.onCameraChanging && props.onCameraChanging(args);
874
910
  }, {
875
911
  location: true
@@ -975,6 +1011,7 @@ var MFMarker = function MFMarker(props) {
975
1011
  markerRef.current.onClick = onClick;
976
1012
  markerRef.current.onRightClick = props.onRightClick;
977
1013
  markerRef.current.onDragEnd = props.onDragEnd;
1014
+ markerRef.current.onHover = props.onHover;
978
1015
  onCreated && onCreated(markerRef.current);
979
1016
  (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker) && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker(markerRef.current));
980
1017
  }
@@ -1431,6 +1468,7 @@ var MFPolygon = function MFPolygon(props) {
1431
1468
  });
1432
1469
  polygonRef.current = new map4d.Polygon(option);
1433
1470
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1471
+ polygonRef.current.onHover = props.onHover;
1434
1472
  onCreated && onCreated(polygonRef.current);
1435
1473
  }
1436
1474
  }, [theMap]);
@@ -1552,6 +1590,8 @@ var MFPolyline = function MFPolyline(props) {
1552
1590
  });
1553
1591
  polylineRef.current = new map4d.Polyline(option);
1554
1592
  (_polylineRef$current = polylineRef.current) === null || _polylineRef$current === void 0 ? void 0 : _polylineRef$current.setMap(theMap);
1593
+ polylineRef.current.onHover = props.onHover;
1594
+ polylineRef.current.onClick = props.onClick;
1555
1595
  onCreated && onCreated(polylineRef.current);
1556
1596
  }
1557
1597
  }, [theMap]);