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.
@@ -22,6 +22,7 @@ interface DirectionsRendererProps {
22
22
  onMarkerDragEnd?: Function;
23
23
  map?: map4d.Map;
24
24
  onCreated?: (directionsRenderer?: map4d.DirectionsRenderer) => void;
25
+ onHover?: (directions: any) => void;
25
26
  }
26
27
  declare const MFDirectionsRenderer: (props: DirectionsRendererProps) => null;
27
28
  export default MFDirectionsRenderer;
@@ -27,6 +27,7 @@ interface MarkerProps {
27
27
  onCreated?: (marker: any) => void;
28
28
  onRightClick?: (marker: any) => void;
29
29
  onDragEnd?: (marker: any) => void;
30
+ onHover?: (marker: any) => void;
30
31
  }
31
32
  declare const MFMarker: (props: MarkerProps) => null;
32
33
  export default MFMarker;
@@ -11,6 +11,7 @@ interface PolygonProps {
11
11
  userInteractionEnabled?: boolean;
12
12
  map?: map4d.Map;
13
13
  onCreated?: (polygon: map4d.Polygon) => void;
14
+ onHover?: (polygon: any) => void;
14
15
  }
15
16
  declare const MFPolygon: (props: PolygonProps) => null;
16
17
  export default MFPolygon;
@@ -12,6 +12,8 @@ interface PolylineProps {
12
12
  userInteractionEnabled?: boolean;
13
13
  map?: map4d.Map;
14
14
  onCreated?: (polyline: map4d.Polyline) => void;
15
+ onHover?: (polyline: any) => void;
16
+ onClick?: (polyline: any) => void;
15
17
  }
16
18
  declare const MFPolyline: (props: PolylineProps) => null;
17
19
  export default MFPolyline;
@@ -3,5 +3,6 @@ export declare const enum MapEventEnum {
3
3
  rightClick = "rightClick",
4
4
  dragEnd = "dragEnd",
5
5
  cameraChanging = "cameraChanging",
6
- tilesLoaded = "tilesLoaded"
6
+ tilesLoaded = "tilesLoaded",
7
+ hover = "hover"
7
8
  }
package/dist/index.js CHANGED
@@ -476,6 +476,7 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
476
476
  });
477
477
  directionRef.current = new map4d.DirectionsRenderer(option);
478
478
  (_directionRef$current = directionRef.current) === null || _directionRef$current === void 0 ? void 0 : _directionRef$current.setMap(theMap);
479
+ directionRef.current.onHover = props.onHover;
479
480
  onCreated && onCreated(directionRef.current);
480
481
  }
481
482
  }, [theMap]);
@@ -811,7 +812,7 @@ var MFMap = function MFMap(props) {
811
812
  }, [props.environment, props.version, props.accessKey]);
812
813
 
813
814
  var registerEvent = function registerEvent() {
814
- var _mapRef$current2, _mapRef$current3, _mapRef$current4;
815
+ var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8, _mapRef$current9;
815
816
 
816
817
  var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
817
818
  var _args$marker, _args$marker2;
@@ -834,12 +835,47 @@ var MFMap = function MFMap(props) {
834
835
  }, {
835
836
  marker: true
836
837
  });
837
- events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker]);
838
+ var eventHoverMarker = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("hover", function (args) {
839
+ var _args$marker7, _args$marker8;
840
+
841
+ ((_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());
842
+ }, {
843
+ marker: true
844
+ });
845
+ var eventHoverPolygon = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("hover", function (args) {
846
+ var _args$polygon, _args$polygon2;
847
+
848
+ ((_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());
849
+ }, {
850
+ polygon: true
851
+ });
852
+ var eventHoverPolyline = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("hover", function (args) {
853
+ var _args$polyline, _args$polyline2;
854
+
855
+ ((_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());
856
+ }, {
857
+ polyline: true
858
+ });
859
+ var eventHoverDirection = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("hover", function (args) {
860
+ var _args$renderer, _args$renderer2;
861
+
862
+ ((_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());
863
+ }, {
864
+ directions: true
865
+ });
866
+ var eventClickPolyline = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("click", function (args) {
867
+ var _args$polyline3, _args$polyline4;
868
+
869
+ ((_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());
870
+ }, {
871
+ polyline: true
872
+ });
873
+ events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline]);
838
874
 
839
875
  if (props.onClickLocation) {
840
- var _mapRef$current5;
876
+ var _mapRef$current10;
841
877
 
842
- var onClickLocation = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("click", function (args) {
878
+ var onClickLocation = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("click", function (args) {
843
879
  props.onClickLocation && props.onClickLocation(args);
844
880
  }, {
845
881
  location: true
@@ -848,9 +884,9 @@ var MFMap = function MFMap(props) {
848
884
  }
849
885
 
850
886
  if (props.onRightClickLocation) {
851
- var _mapRef$current6;
887
+ var _mapRef$current11;
852
888
 
853
- var onRightClickLocation = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("rightClick", function (args) {
889
+ var onRightClickLocation = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("rightClick", function (args) {
854
890
  props.onRightClickLocation && props.onRightClickLocation(args);
855
891
  }, {
856
892
  location: true
@@ -859,9 +895,9 @@ var MFMap = function MFMap(props) {
859
895
  }
860
896
 
861
897
  if (props.onTilesLoaded) {
862
- var _mapRef$current7;
898
+ var _mapRef$current12;
863
899
 
864
- var onTilesLoaded = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("tilesLoaded", function (args) {
900
+ var onTilesLoaded = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("tilesLoaded", function (args) {
865
901
  props.onTilesLoaded && props.onTilesLoaded(args);
866
902
  }, {
867
903
  location: true
@@ -870,9 +906,9 @@ var MFMap = function MFMap(props) {
870
906
  }
871
907
 
872
908
  if (props.onCameraChanging) {
873
- var _mapRef$current8;
909
+ var _mapRef$current13;
874
910
 
875
- var onCameraChanging = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("cameraChanging", function (args) {
911
+ var onCameraChanging = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("cameraChanging", function (args) {
876
912
  props.onCameraChanging && props.onCameraChanging(args);
877
913
  }, {
878
914
  location: true
@@ -978,6 +1014,7 @@ var MFMarker = function MFMarker(props) {
978
1014
  markerRef.current.onClick = onClick;
979
1015
  markerRef.current.onRightClick = props.onRightClick;
980
1016
  markerRef.current.onDragEnd = props.onDragEnd;
1017
+ markerRef.current.onHover = props.onHover;
981
1018
  onCreated && onCreated(markerRef.current);
982
1019
  (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker) && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker(markerRef.current));
983
1020
  }
@@ -1434,6 +1471,7 @@ var MFPolygon = function MFPolygon(props) {
1434
1471
  });
1435
1472
  polygonRef.current = new map4d.Polygon(option);
1436
1473
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1474
+ polygonRef.current.onHover = props.onHover;
1437
1475
  onCreated && onCreated(polygonRef.current);
1438
1476
  }
1439
1477
  }, [theMap]);
@@ -1555,6 +1593,8 @@ var MFPolyline = function MFPolyline(props) {
1555
1593
  });
1556
1594
  polylineRef.current = new map4d.Polyline(option);
1557
1595
  (_polylineRef$current = polylineRef.current) === null || _polylineRef$current === void 0 ? void 0 : _polylineRef$current.setMap(theMap);
1596
+ polylineRef.current.onHover = props.onHover;
1597
+ polylineRef.current.onClick = props.onClick;
1558
1598
  onCreated && onCreated(polylineRef.current);
1559
1599
  }
1560
1600
  }, [theMap]);