react-map4d-map 1.1.9 → 1.2.0

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,7 @@ interface PolylineProps {
12
12
  userInteractionEnabled?: boolean;
13
13
  map?: map4d.Map;
14
14
  onCreated?: (polyline: map4d.Polyline) => void;
15
+ onHover?: (polyline: any) => void;
15
16
  }
16
17
  declare const MFPolyline: (props: PolylineProps) => null;
17
18
  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;
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,40 @@ 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
+ events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection]);
838
867
 
839
868
  if (props.onClickLocation) {
840
- var _mapRef$current5;
869
+ var _mapRef$current9;
841
870
 
842
- var onClickLocation = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("click", function (args) {
871
+ var onClickLocation = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("click", function (args) {
843
872
  props.onClickLocation && props.onClickLocation(args);
844
873
  }, {
845
874
  location: true
@@ -848,9 +877,9 @@ var MFMap = function MFMap(props) {
848
877
  }
849
878
 
850
879
  if (props.onRightClickLocation) {
851
- var _mapRef$current6;
880
+ var _mapRef$current10;
852
881
 
853
- var onRightClickLocation = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("rightClick", function (args) {
882
+ var onRightClickLocation = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("rightClick", function (args) {
854
883
  props.onRightClickLocation && props.onRightClickLocation(args);
855
884
  }, {
856
885
  location: true
@@ -859,9 +888,9 @@ var MFMap = function MFMap(props) {
859
888
  }
860
889
 
861
890
  if (props.onTilesLoaded) {
862
- var _mapRef$current7;
891
+ var _mapRef$current11;
863
892
 
864
- var onTilesLoaded = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("tilesLoaded", function (args) {
893
+ var onTilesLoaded = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("tilesLoaded", function (args) {
865
894
  props.onTilesLoaded && props.onTilesLoaded(args);
866
895
  }, {
867
896
  location: true
@@ -870,9 +899,9 @@ var MFMap = function MFMap(props) {
870
899
  }
871
900
 
872
901
  if (props.onCameraChanging) {
873
- var _mapRef$current8;
902
+ var _mapRef$current12;
874
903
 
875
- var onCameraChanging = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("cameraChanging", function (args) {
904
+ var onCameraChanging = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("cameraChanging", function (args) {
876
905
  props.onCameraChanging && props.onCameraChanging(args);
877
906
  }, {
878
907
  location: true
@@ -978,6 +1007,7 @@ var MFMarker = function MFMarker(props) {
978
1007
  markerRef.current.onClick = onClick;
979
1008
  markerRef.current.onRightClick = props.onRightClick;
980
1009
  markerRef.current.onDragEnd = props.onDragEnd;
1010
+ markerRef.current.onHover = props.onHover;
981
1011
  onCreated && onCreated(markerRef.current);
982
1012
  (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker) && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker(markerRef.current));
983
1013
  }
@@ -1434,6 +1464,7 @@ var MFPolygon = function MFPolygon(props) {
1434
1464
  });
1435
1465
  polygonRef.current = new map4d.Polygon(option);
1436
1466
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1467
+ polygonRef.current.onHover = props.onHover;
1437
1468
  onCreated && onCreated(polygonRef.current);
1438
1469
  }
1439
1470
  }, [theMap]);
@@ -1555,6 +1586,7 @@ var MFPolyline = function MFPolyline(props) {
1555
1586
  });
1556
1587
  polylineRef.current = new map4d.Polyline(option);
1557
1588
  (_polylineRef$current = polylineRef.current) === null || _polylineRef$current === void 0 ? void 0 : _polylineRef$current.setMap(theMap);
1589
+ polylineRef.current.onHover = props.onHover;
1558
1590
  onCreated && onCreated(polylineRef.current);
1559
1591
  }
1560
1592
  }, [theMap]);