react-map4d-map 1.2.0 → 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.
- package/dist/components/MFPolyline.d.ts +1 -0
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +18 -10
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ interface PolylineProps {
|
|
|
13
13
|
map?: map4d.Map;
|
|
14
14
|
onCreated?: (polyline: map4d.Polyline) => void;
|
|
15
15
|
onHover?: (polyline: any) => void;
|
|
16
|
+
onClick?: (polyline: any) => void;
|
|
16
17
|
}
|
|
17
18
|
declare const MFPolyline: (props: PolylineProps) => null;
|
|
18
19
|
export default MFPolyline;
|
package/dist/index.js
CHANGED
|
@@ -812,7 +812,7 @@ var MFMap = function MFMap(props) {
|
|
|
812
812
|
}, [props.environment, props.version, props.accessKey]);
|
|
813
813
|
|
|
814
814
|
var registerEvent = function registerEvent() {
|
|
815
|
-
var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8;
|
|
815
|
+
var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8, _mapRef$current9;
|
|
816
816
|
|
|
817
817
|
var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
|
|
818
818
|
var _args$marker, _args$marker2;
|
|
@@ -863,12 +863,19 @@ var MFMap = function MFMap(props) {
|
|
|
863
863
|
}, {
|
|
864
864
|
directions: true
|
|
865
865
|
});
|
|
866
|
-
|
|
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]);
|
|
867
874
|
|
|
868
875
|
if (props.onClickLocation) {
|
|
869
|
-
var _mapRef$
|
|
876
|
+
var _mapRef$current10;
|
|
870
877
|
|
|
871
|
-
var onClickLocation = (_mapRef$
|
|
878
|
+
var onClickLocation = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("click", function (args) {
|
|
872
879
|
props.onClickLocation && props.onClickLocation(args);
|
|
873
880
|
}, {
|
|
874
881
|
location: true
|
|
@@ -877,9 +884,9 @@ var MFMap = function MFMap(props) {
|
|
|
877
884
|
}
|
|
878
885
|
|
|
879
886
|
if (props.onRightClickLocation) {
|
|
880
|
-
var _mapRef$
|
|
887
|
+
var _mapRef$current11;
|
|
881
888
|
|
|
882
|
-
var onRightClickLocation = (_mapRef$
|
|
889
|
+
var onRightClickLocation = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("rightClick", function (args) {
|
|
883
890
|
props.onRightClickLocation && props.onRightClickLocation(args);
|
|
884
891
|
}, {
|
|
885
892
|
location: true
|
|
@@ -888,9 +895,9 @@ var MFMap = function MFMap(props) {
|
|
|
888
895
|
}
|
|
889
896
|
|
|
890
897
|
if (props.onTilesLoaded) {
|
|
891
|
-
var _mapRef$
|
|
898
|
+
var _mapRef$current12;
|
|
892
899
|
|
|
893
|
-
var onTilesLoaded = (_mapRef$
|
|
900
|
+
var onTilesLoaded = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("tilesLoaded", function (args) {
|
|
894
901
|
props.onTilesLoaded && props.onTilesLoaded(args);
|
|
895
902
|
}, {
|
|
896
903
|
location: true
|
|
@@ -899,9 +906,9 @@ var MFMap = function MFMap(props) {
|
|
|
899
906
|
}
|
|
900
907
|
|
|
901
908
|
if (props.onCameraChanging) {
|
|
902
|
-
var _mapRef$
|
|
909
|
+
var _mapRef$current13;
|
|
903
910
|
|
|
904
|
-
var onCameraChanging = (_mapRef$
|
|
911
|
+
var onCameraChanging = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("cameraChanging", function (args) {
|
|
905
912
|
props.onCameraChanging && props.onCameraChanging(args);
|
|
906
913
|
}, {
|
|
907
914
|
location: true
|
|
@@ -1587,6 +1594,7 @@ var MFPolyline = function MFPolyline(props) {
|
|
|
1587
1594
|
polylineRef.current = new map4d.Polyline(option);
|
|
1588
1595
|
(_polylineRef$current = polylineRef.current) === null || _polylineRef$current === void 0 ? void 0 : _polylineRef$current.setMap(theMap);
|
|
1589
1596
|
polylineRef.current.onHover = props.onHover;
|
|
1597
|
+
polylineRef.current.onClick = props.onClick;
|
|
1590
1598
|
onCreated && onCreated(polylineRef.current);
|
|
1591
1599
|
}
|
|
1592
1600
|
}, [theMap]);
|