react-map4d-map 1.2.3 → 1.2.4
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.
- package/dist/components/MFDirectionsRenderer.d.ts +3 -0
- package/dist/components/MFMarker.d.ts +3 -0
- package/dist/components/MFPolyline.d.ts +3 -0
- package/dist/enum/mapEventEnum.d.ts +4 -1
- package/dist/index.js +139 -13
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +139 -13
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,6 +23,9 @@ interface DirectionsRendererProps {
|
|
|
23
23
|
map?: map4d.Map;
|
|
24
24
|
onCreated?: (directionsRenderer?: map4d.DirectionsRenderer) => void;
|
|
25
25
|
onHover?: (directions: any) => void;
|
|
26
|
+
onMouseOut?: (marker: any) => void;
|
|
27
|
+
onMouseOver?: (marker: any) => void;
|
|
28
|
+
onMouseMove?: (marker: any) => void;
|
|
26
29
|
}
|
|
27
30
|
declare const MFDirectionsRenderer: (props: DirectionsRendererProps) => null;
|
|
28
31
|
export default MFDirectionsRenderer;
|
|
@@ -28,6 +28,9 @@ interface MarkerProps {
|
|
|
28
28
|
onRightClick?: (marker: any) => void;
|
|
29
29
|
onDragEnd?: (marker: any) => void;
|
|
30
30
|
onHover?: (marker: any) => void;
|
|
31
|
+
onMouseOut?: (marker: any) => void;
|
|
32
|
+
onMouseOver?: (marker: any) => void;
|
|
33
|
+
onMouseMove?: (marker: any) => void;
|
|
31
34
|
}
|
|
32
35
|
declare const MFMarker: (props: MarkerProps) => null;
|
|
33
36
|
export default MFMarker;
|
|
@@ -14,6 +14,9 @@ interface PolylineProps {
|
|
|
14
14
|
onCreated?: (polyline: map4d.Polyline) => void;
|
|
15
15
|
onHover?: (polyline: any) => void;
|
|
16
16
|
onClick?: (polyline: any) => void;
|
|
17
|
+
onMouseOut?: (marker: any) => void;
|
|
18
|
+
onMouseOver?: (marker: any) => void;
|
|
19
|
+
onMouseMove?: (marker: any) => void;
|
|
17
20
|
}
|
|
18
21
|
declare const MFPolyline: (props: PolylineProps) => null;
|
|
19
22
|
export default MFPolyline;
|
package/dist/index.js
CHANGED
|
@@ -444,7 +444,10 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
|
|
|
444
444
|
onMarkerDragEnd = props.onMarkerDragEnd,
|
|
445
445
|
map = props.map,
|
|
446
446
|
onHover = props.onHover,
|
|
447
|
-
onCreated = props.onCreated
|
|
447
|
+
onCreated = props.onCreated,
|
|
448
|
+
onMouseOut = props.onMouseOut,
|
|
449
|
+
onMouseOver = props.onMouseOver,
|
|
450
|
+
onMouseMove = props.onMouseMove;
|
|
448
451
|
var map4dContext = React.useContext(Map4dContext);
|
|
449
452
|
var theMap = map || map4dContext.map;
|
|
450
453
|
var directionRef = React.useRef();
|
|
@@ -478,6 +481,9 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
|
|
|
478
481
|
directionRef.current = new map4d.DirectionsRenderer(option);
|
|
479
482
|
(_directionRef$current = directionRef.current) === null || _directionRef$current === void 0 ? void 0 : _directionRef$current.setMap(theMap);
|
|
480
483
|
directionRef.current.onHover = props.onHover;
|
|
484
|
+
directionRef.current.onMouseOut = onMouseOut;
|
|
485
|
+
directionRef.current.onMouseOver = onMouseOver;
|
|
486
|
+
directionRef.current.onMouseMove = onMouseMove;
|
|
481
487
|
onCreated && onCreated(directionRef.current);
|
|
482
488
|
}
|
|
483
489
|
}, [theMap]);
|
|
@@ -486,6 +492,21 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
|
|
|
486
492
|
directionRef.current.onHover = onHover;
|
|
487
493
|
}
|
|
488
494
|
}, [onHover]);
|
|
495
|
+
React.useEffect(function () {
|
|
496
|
+
if (directionRef.current) {
|
|
497
|
+
directionRef.current.onMouseOut = onMouseOut;
|
|
498
|
+
}
|
|
499
|
+
}, [onMouseOut]);
|
|
500
|
+
React.useEffect(function () {
|
|
501
|
+
if (directionRef.current) {
|
|
502
|
+
directionRef.current.onMouseOver = onMouseOver;
|
|
503
|
+
}
|
|
504
|
+
}, [onMouseOver]);
|
|
505
|
+
React.useEffect(function () {
|
|
506
|
+
if (directionRef.current) {
|
|
507
|
+
directionRef.current.onMouseMove = onMouseMove;
|
|
508
|
+
}
|
|
509
|
+
}, [onMouseMove]);
|
|
489
510
|
React.useEffect(function () {
|
|
490
511
|
if (theMap) {
|
|
491
512
|
var _directionRef$current2;
|
|
@@ -818,7 +839,7 @@ var MFMap = function MFMap(props) {
|
|
|
818
839
|
}, [props.environment, props.version, props.accessKey]);
|
|
819
840
|
|
|
820
841
|
var registerEvent = function registerEvent() {
|
|
821
|
-
var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8, _mapRef$current9;
|
|
842
|
+
var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8, _mapRef$current9, _mapRef$current10, _mapRef$current11, _mapRef$current12, _mapRef$current13, _mapRef$current14, _mapRef$current15, _mapRef$current16, _mapRef$current17, _mapRef$current18;
|
|
822
843
|
|
|
823
844
|
var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
|
|
824
845
|
var _args$marker, _args$marker2;
|
|
@@ -876,12 +897,75 @@ var MFMap = function MFMap(props) {
|
|
|
876
897
|
}, {
|
|
877
898
|
polyline: true
|
|
878
899
|
});
|
|
879
|
-
|
|
900
|
+
var eventMouseOutDirection = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("mouseOut", function (args) {
|
|
901
|
+
var _args$renderer3, _args$renderer4;
|
|
902
|
+
|
|
903
|
+
((_args$renderer3 = args.renderer) === null || _args$renderer3 === void 0 ? void 0 : _args$renderer3.onMouseOut) && ((_args$renderer4 = args.renderer) === null || _args$renderer4 === void 0 ? void 0 : _args$renderer4.onMouseOut());
|
|
904
|
+
}, {
|
|
905
|
+
directions: true
|
|
906
|
+
});
|
|
907
|
+
var eventMouseOverDirection = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("mouseOver", function (args) {
|
|
908
|
+
var _args$renderer5, _args$renderer6;
|
|
909
|
+
|
|
910
|
+
((_args$renderer5 = args.renderer) === null || _args$renderer5 === void 0 ? void 0 : _args$renderer5.onMouseOver) && ((_args$renderer6 = args.renderer) === null || _args$renderer6 === void 0 ? void 0 : _args$renderer6.onMouseOver());
|
|
911
|
+
}, {
|
|
912
|
+
directions: true
|
|
913
|
+
});
|
|
914
|
+
var eventMouseMoveDirection = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("mouseMove", function (args) {
|
|
915
|
+
var _args$renderer7, _args$renderer8;
|
|
916
|
+
|
|
917
|
+
((_args$renderer7 = args.renderer) === null || _args$renderer7 === void 0 ? void 0 : _args$renderer7.onMouseMove) && ((_args$renderer8 = args.renderer) === null || _args$renderer8 === void 0 ? void 0 : _args$renderer8.onMouseMove());
|
|
918
|
+
}, {
|
|
919
|
+
directions: true
|
|
920
|
+
});
|
|
921
|
+
var eventMouseOutPolyline = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("mouseOut", function (args) {
|
|
922
|
+
var _args$polyline5, _args$polyline6;
|
|
923
|
+
|
|
924
|
+
((_args$polyline5 = args.polyline) === null || _args$polyline5 === void 0 ? void 0 : _args$polyline5.onMouseOut) && ((_args$polyline6 = args.polyline) === null || _args$polyline6 === void 0 ? void 0 : _args$polyline6.onMouseOut());
|
|
925
|
+
}, {
|
|
926
|
+
polyline: true
|
|
927
|
+
});
|
|
928
|
+
var eventMouseOverPolyline = (_mapRef$current14 = mapRef.current) === null || _mapRef$current14 === void 0 ? void 0 : _mapRef$current14.addListener("mouseOver", function (args) {
|
|
929
|
+
var _args$polyline7, _args$polyline8;
|
|
930
|
+
|
|
931
|
+
((_args$polyline7 = args.polyline) === null || _args$polyline7 === void 0 ? void 0 : _args$polyline7.onMouseOver) && ((_args$polyline8 = args.polyline) === null || _args$polyline8 === void 0 ? void 0 : _args$polyline8.onMouseOver());
|
|
932
|
+
}, {
|
|
933
|
+
polyline: true
|
|
934
|
+
});
|
|
935
|
+
var eventMouseMovePolyline = (_mapRef$current15 = mapRef.current) === null || _mapRef$current15 === void 0 ? void 0 : _mapRef$current15.addListener("mouseMove", function (args) {
|
|
936
|
+
var _args$polyline9, _args$polyline10;
|
|
937
|
+
|
|
938
|
+
((_args$polyline9 = args.polyline) === null || _args$polyline9 === void 0 ? void 0 : _args$polyline9.onMouseMove) && ((_args$polyline10 = args.polyline) === null || _args$polyline10 === void 0 ? void 0 : _args$polyline10.onMouseMove());
|
|
939
|
+
}, {
|
|
940
|
+
polyline: true
|
|
941
|
+
});
|
|
942
|
+
var eventMouseOutMarker = (_mapRef$current16 = mapRef.current) === null || _mapRef$current16 === void 0 ? void 0 : _mapRef$current16.addListener("mouseOut", function (args) {
|
|
943
|
+
var _args$marker9, _args$marker10;
|
|
944
|
+
|
|
945
|
+
((_args$marker9 = args.marker) === null || _args$marker9 === void 0 ? void 0 : _args$marker9.onMouseOut) && ((_args$marker10 = args.marker) === null || _args$marker10 === void 0 ? void 0 : _args$marker10.onMouseOut());
|
|
946
|
+
}, {
|
|
947
|
+
marker: true
|
|
948
|
+
});
|
|
949
|
+
var eventMouseOverMarker = (_mapRef$current17 = mapRef.current) === null || _mapRef$current17 === void 0 ? void 0 : _mapRef$current17.addListener("mouseOver", function (args) {
|
|
950
|
+
var _args$marker11, _args$marker12;
|
|
951
|
+
|
|
952
|
+
((_args$marker11 = args.marker) === null || _args$marker11 === void 0 ? void 0 : _args$marker11.onMouseOver) && ((_args$marker12 = args.marker) === null || _args$marker12 === void 0 ? void 0 : _args$marker12.onMouseOver());
|
|
953
|
+
}, {
|
|
954
|
+
marker: true
|
|
955
|
+
});
|
|
956
|
+
var eventMouseMoveMarker = (_mapRef$current18 = mapRef.current) === null || _mapRef$current18 === void 0 ? void 0 : _mapRef$current18.addListener("mouseMove", function (args) {
|
|
957
|
+
var _args$marker13, _args$marker14;
|
|
958
|
+
|
|
959
|
+
((_args$marker13 = args.marker) === null || _args$marker13 === void 0 ? void 0 : _args$marker13.onMouseMove) && ((_args$marker14 = args.marker) === null || _args$marker14 === void 0 ? void 0 : _args$marker14.onMouseMove());
|
|
960
|
+
}, {
|
|
961
|
+
marker: true
|
|
962
|
+
});
|
|
963
|
+
events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline, eventMouseOutDirection, eventMouseOverDirection, eventMouseMoveDirection, eventMouseOutPolyline, eventMouseOverPolyline, eventMouseMovePolyline, eventMouseOutMarker, eventMouseOverMarker, eventMouseMoveMarker]);
|
|
880
964
|
|
|
881
965
|
if (props.onClickLocation) {
|
|
882
|
-
var _mapRef$
|
|
966
|
+
var _mapRef$current19;
|
|
883
967
|
|
|
884
|
-
var onClickLocation = (_mapRef$
|
|
968
|
+
var onClickLocation = (_mapRef$current19 = mapRef.current) === null || _mapRef$current19 === void 0 ? void 0 : _mapRef$current19.addListener("click", function (args) {
|
|
885
969
|
props.onClickLocation && props.onClickLocation(args);
|
|
886
970
|
}, {
|
|
887
971
|
location: true
|
|
@@ -890,9 +974,9 @@ var MFMap = function MFMap(props) {
|
|
|
890
974
|
}
|
|
891
975
|
|
|
892
976
|
if (props.onRightClickLocation) {
|
|
893
|
-
var _mapRef$
|
|
977
|
+
var _mapRef$current20;
|
|
894
978
|
|
|
895
|
-
var onRightClickLocation = (_mapRef$
|
|
979
|
+
var onRightClickLocation = (_mapRef$current20 = mapRef.current) === null || _mapRef$current20 === void 0 ? void 0 : _mapRef$current20.addListener("rightClick", function (args) {
|
|
896
980
|
props.onRightClickLocation && props.onRightClickLocation(args);
|
|
897
981
|
}, {
|
|
898
982
|
location: true
|
|
@@ -901,9 +985,9 @@ var MFMap = function MFMap(props) {
|
|
|
901
985
|
}
|
|
902
986
|
|
|
903
987
|
if (props.onTilesLoaded) {
|
|
904
|
-
var _mapRef$
|
|
988
|
+
var _mapRef$current21;
|
|
905
989
|
|
|
906
|
-
var onTilesLoaded = (_mapRef$
|
|
990
|
+
var onTilesLoaded = (_mapRef$current21 = mapRef.current) === null || _mapRef$current21 === void 0 ? void 0 : _mapRef$current21.addListener("tilesLoaded", function (args) {
|
|
907
991
|
props.onTilesLoaded && props.onTilesLoaded(args);
|
|
908
992
|
}, {
|
|
909
993
|
location: true
|
|
@@ -912,9 +996,9 @@ var MFMap = function MFMap(props) {
|
|
|
912
996
|
}
|
|
913
997
|
|
|
914
998
|
if (props.onCameraChanging) {
|
|
915
|
-
var _mapRef$
|
|
999
|
+
var _mapRef$current22;
|
|
916
1000
|
|
|
917
|
-
var onCameraChanging = (_mapRef$
|
|
1001
|
+
var onCameraChanging = (_mapRef$current22 = mapRef.current) === null || _mapRef$current22 === void 0 ? void 0 : _mapRef$current22.addListener("cameraChanging", function (args) {
|
|
918
1002
|
props.onCameraChanging && props.onCameraChanging(args);
|
|
919
1003
|
}, {
|
|
920
1004
|
location: true
|
|
@@ -965,7 +1049,10 @@ var MFMarker = function MFMarker(props) {
|
|
|
965
1049
|
onClick = props.onClick,
|
|
966
1050
|
onRightClick = props.onRightClick,
|
|
967
1051
|
onDragEnd = props.onDragEnd,
|
|
968
|
-
onHover = props.onHover
|
|
1052
|
+
onHover = props.onHover,
|
|
1053
|
+
onMouseOut = props.onMouseOut,
|
|
1054
|
+
onMouseOver = props.onMouseOver,
|
|
1055
|
+
onMouseMove = props.onMouseMove;
|
|
969
1056
|
var map4dContext = React.useContext(Map4dContext);
|
|
970
1057
|
var markerClusterContext = React.useContext(MarkerClusterContext);
|
|
971
1058
|
var theMap = map || map4dContext.map;
|
|
@@ -1026,6 +1113,9 @@ var MFMarker = function MFMarker(props) {
|
|
|
1026
1113
|
markerRef.current.onRightClick = props.onRightClick;
|
|
1027
1114
|
markerRef.current.onDragEnd = props.onDragEnd;
|
|
1028
1115
|
markerRef.current.onHover = props.onHover;
|
|
1116
|
+
markerRef.current.onMouseOut = onMouseOut;
|
|
1117
|
+
markerRef.current.onMouseOver = onMouseOver;
|
|
1118
|
+
markerRef.current.onMouseMove = onMouseMove;
|
|
1029
1119
|
onCreated && onCreated(markerRef.current);
|
|
1030
1120
|
(markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker) && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker(markerRef.current));
|
|
1031
1121
|
}
|
|
@@ -1063,6 +1153,21 @@ var MFMarker = function MFMarker(props) {
|
|
|
1063
1153
|
markerRef.current.onHover = onHover;
|
|
1064
1154
|
}
|
|
1065
1155
|
}, [onHover]);
|
|
1156
|
+
React.useEffect(function () {
|
|
1157
|
+
if (markerRef.current) {
|
|
1158
|
+
markerRef.current.onMouseOut = onMouseOut;
|
|
1159
|
+
}
|
|
1160
|
+
}, [onMouseOut]);
|
|
1161
|
+
React.useEffect(function () {
|
|
1162
|
+
if (markerRef.current) {
|
|
1163
|
+
markerRef.current.onMouseOver = onMouseOver;
|
|
1164
|
+
}
|
|
1165
|
+
}, [onMouseOver]);
|
|
1166
|
+
React.useEffect(function () {
|
|
1167
|
+
if (markerRef.current) {
|
|
1168
|
+
markerRef.current.onMouseMove = onMouseMove;
|
|
1169
|
+
}
|
|
1170
|
+
}, [onMouseMove]);
|
|
1066
1171
|
React.useEffect(function () {
|
|
1067
1172
|
if (markerRef.current) {
|
|
1068
1173
|
markerRef.current.onClick = onClick;
|
|
@@ -1603,7 +1708,10 @@ var MFPolyline = function MFPolyline(props) {
|
|
|
1603
1708
|
map = props.map,
|
|
1604
1709
|
onClick = props.onClick,
|
|
1605
1710
|
onHover = props.onHover,
|
|
1606
|
-
onCreated = props.onCreated
|
|
1711
|
+
onCreated = props.onCreated,
|
|
1712
|
+
onMouseOut = props.onMouseOut,
|
|
1713
|
+
onMouseOver = props.onMouseOver,
|
|
1714
|
+
onMouseMove = props.onMouseMove;
|
|
1607
1715
|
var map4dContext = React.useContext(Map4dContext);
|
|
1608
1716
|
var theMap = map || map4dContext.map;
|
|
1609
1717
|
var polylineRef = React.useRef();
|
|
@@ -1636,6 +1744,9 @@ var MFPolyline = function MFPolyline(props) {
|
|
|
1636
1744
|
(_polylineRef$current = polylineRef.current) === null || _polylineRef$current === void 0 ? void 0 : _polylineRef$current.setMap(theMap);
|
|
1637
1745
|
polylineRef.current.onHover = props.onHover;
|
|
1638
1746
|
polylineRef.current.onClick = props.onClick;
|
|
1747
|
+
polylineRef.current.onMouseOut = onMouseOut;
|
|
1748
|
+
polylineRef.current.onMouseOver = onMouseOver;
|
|
1749
|
+
polylineRef.current.onMouseMove = onMouseMove;
|
|
1639
1750
|
onCreated && onCreated(polylineRef.current);
|
|
1640
1751
|
}
|
|
1641
1752
|
}, [theMap]);
|
|
@@ -1664,6 +1775,21 @@ var MFPolyline = function MFPolyline(props) {
|
|
|
1664
1775
|
polylineRef.current.onHover = onHover;
|
|
1665
1776
|
}
|
|
1666
1777
|
}, [onHover]);
|
|
1778
|
+
React.useEffect(function () {
|
|
1779
|
+
if (polylineRef.current) {
|
|
1780
|
+
polylineRef.current.onMouseOut = onMouseOut;
|
|
1781
|
+
}
|
|
1782
|
+
}, [onMouseOut]);
|
|
1783
|
+
React.useEffect(function () {
|
|
1784
|
+
if (polylineRef.current) {
|
|
1785
|
+
polylineRef.current.onMouseOver = onMouseOver;
|
|
1786
|
+
}
|
|
1787
|
+
}, [onMouseOver]);
|
|
1788
|
+
React.useEffect(function () {
|
|
1789
|
+
if (polylineRef.current) {
|
|
1790
|
+
polylineRef.current.onMouseMove = onMouseMove;
|
|
1791
|
+
}
|
|
1792
|
+
}, [onMouseMove]);
|
|
1667
1793
|
React.useEffect(function () {
|
|
1668
1794
|
if (polylineRef.current) {
|
|
1669
1795
|
polylineRef.current.onClick = onClick;
|