react-map4d-map 1.1.8 → 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.
@@ -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]);
@@ -766,7 +767,13 @@ var MFMap = function MFMap(props) {
766
767
  };
767
768
  };
768
769
 
769
- var urlNew = "https://api" + (props.environment ? "-" + props.environment : "") + ".map4d.vn/sdk/map/js?version=" + props.version + "&key=" + props.accessKey + "&callback=" + callback.current;
770
+ var domain = "https://api" + (props.environment ? "-" + props.environment : "") + ".map4d.vn";
771
+
772
+ if (props.sdkDomain) {
773
+ domain = props.sdkDomain;
774
+ }
775
+
776
+ var urlNew = domain + "/sdk/map/js?version=" + props.version + "&key=" + props.accessKey + "&callback=" + callback.current;
770
777
 
771
778
  if (props.mapid) {
772
779
  urlNew += "&mapId=" + props.mapid;
@@ -802,7 +809,7 @@ var MFMap = function MFMap(props) {
802
809
  }, [props.environment, props.version, props.accessKey]);
803
810
 
804
811
  var registerEvent = function registerEvent() {
805
- var _mapRef$current2, _mapRef$current3, _mapRef$current4;
812
+ var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8;
806
813
 
807
814
  var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
808
815
  var _args$marker, _args$marker2;
@@ -825,12 +832,40 @@ var MFMap = function MFMap(props) {
825
832
  }, {
826
833
  marker: true
827
834
  });
828
- 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
+ events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection]);
829
864
 
830
865
  if (props.onClickLocation) {
831
- var _mapRef$current5;
866
+ var _mapRef$current9;
832
867
 
833
- var onClickLocation = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("click", function (args) {
868
+ var onClickLocation = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("click", function (args) {
834
869
  props.onClickLocation && props.onClickLocation(args);
835
870
  }, {
836
871
  location: true
@@ -839,9 +874,9 @@ var MFMap = function MFMap(props) {
839
874
  }
840
875
 
841
876
  if (props.onRightClickLocation) {
842
- var _mapRef$current6;
877
+ var _mapRef$current10;
843
878
 
844
- var onRightClickLocation = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("rightClick", function (args) {
879
+ var onRightClickLocation = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("rightClick", function (args) {
845
880
  props.onRightClickLocation && props.onRightClickLocation(args);
846
881
  }, {
847
882
  location: true
@@ -850,9 +885,9 @@ var MFMap = function MFMap(props) {
850
885
  }
851
886
 
852
887
  if (props.onTilesLoaded) {
853
- var _mapRef$current7;
888
+ var _mapRef$current11;
854
889
 
855
- var onTilesLoaded = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("tilesLoaded", function (args) {
890
+ var onTilesLoaded = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("tilesLoaded", function (args) {
856
891
  props.onTilesLoaded && props.onTilesLoaded(args);
857
892
  }, {
858
893
  location: true
@@ -861,9 +896,9 @@ var MFMap = function MFMap(props) {
861
896
  }
862
897
 
863
898
  if (props.onCameraChanging) {
864
- var _mapRef$current8;
899
+ var _mapRef$current12;
865
900
 
866
- var onCameraChanging = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("cameraChanging", function (args) {
901
+ var onCameraChanging = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("cameraChanging", function (args) {
867
902
  props.onCameraChanging && props.onCameraChanging(args);
868
903
  }, {
869
904
  location: true
@@ -969,6 +1004,7 @@ var MFMarker = function MFMarker(props) {
969
1004
  markerRef.current.onClick = onClick;
970
1005
  markerRef.current.onRightClick = props.onRightClick;
971
1006
  markerRef.current.onDragEnd = props.onDragEnd;
1007
+ markerRef.current.onHover = props.onHover;
972
1008
  onCreated && onCreated(markerRef.current);
973
1009
  (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker) && (markerClusterContext === null || markerClusterContext === void 0 ? void 0 : markerClusterContext.addMarker(markerRef.current));
974
1010
  }
@@ -1425,6 +1461,7 @@ var MFPolygon = function MFPolygon(props) {
1425
1461
  });
1426
1462
  polygonRef.current = new map4d.Polygon(option);
1427
1463
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1464
+ polygonRef.current.onHover = props.onHover;
1428
1465
  onCreated && onCreated(polygonRef.current);
1429
1466
  }
1430
1467
  }, [theMap]);
@@ -1546,6 +1583,7 @@ var MFPolyline = function MFPolyline(props) {
1546
1583
  });
1547
1584
  polylineRef.current = new map4d.Polyline(option);
1548
1585
  (_polylineRef$current = polylineRef.current) === null || _polylineRef$current === void 0 ? void 0 : _polylineRef$current.setMap(theMap);
1586
+ polylineRef.current.onHover = props.onHover;
1549
1587
  onCreated && onCreated(polylineRef.current);
1550
1588
  }
1551
1589
  }, [theMap]);