react-map4d-map 1.3.4 → 1.3.6

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/index.js CHANGED
@@ -26,7 +26,7 @@ var MFBuilding = function MFBuilding(props) {
26
26
  coordinates = props.coordinates,
27
27
  visible = props.visible,
28
28
  draggable = props.draggable,
29
- clickable = props.clickable,
29
+ userInteractionEnabled = props.userInteractionEnabled,
30
30
  selected = props.selected,
31
31
  growUp = props.growUp,
32
32
  map = props.map,
@@ -53,7 +53,7 @@ var MFBuilding = function MFBuilding(props) {
53
53
  coordinates: coordinates,
54
54
  visible: visible,
55
55
  draggable: draggable,
56
- clickable: clickable,
56
+ userInteractionEnabled: userInteractionEnabled,
57
57
  selected: selected,
58
58
  growUp: growUp
59
59
  };
@@ -147,8 +147,8 @@ var MFBuilding = function MFBuilding(props) {
147
147
  React.useEffect(function () {
148
148
  var _buildingRef$current16;
149
149
 
150
- clickable != undefined && ((_buildingRef$current16 = buildingRef.current) === null || _buildingRef$current16 === void 0 ? void 0 : _buildingRef$current16.setClickable(clickable));
151
- }, [clickable]);
150
+ userInteractionEnabled != undefined && ((_buildingRef$current16 = buildingRef.current) === null || _buildingRef$current16 === void 0 ? void 0 : _buildingRef$current16.setUserInteraction(userInteractionEnabled));
151
+ }, [userInteractionEnabled]);
152
152
  React.useEffect(function () {
153
153
  var _buildingRef$current17;
154
154
 
@@ -250,9 +250,10 @@ var MFCircle = function MFCircle(props) {
250
250
  draggable = props.draggable,
251
251
  zIndex = props.zIndex,
252
252
  elevation = props.elevation,
253
- clickable = props.clickable,
253
+ userInteractionEnabled = props.userInteractionEnabled,
254
254
  map = props.map,
255
- onCreated = props.onCreated;
255
+ onCreated = props.onCreated,
256
+ onClick = props.onClick;
256
257
  var map4dContext = React.useContext(Map4dContext);
257
258
  var theMap = map || map4dContext.map;
258
259
  var circleRef = React.useRef();
@@ -274,7 +275,7 @@ var MFCircle = function MFCircle(props) {
274
275
  draggable: draggable,
275
276
  zIndex: zIndex,
276
277
  elevation: elevation,
277
- clickable: clickable
278
+ userInteractionEnabled: userInteractionEnabled
278
279
  };
279
280
  Object.keys(option).forEach(function (key) {
280
281
  if (option[key] == undefined || option[key] == null) {
@@ -284,8 +285,14 @@ var MFCircle = function MFCircle(props) {
284
285
  circleRef.current = new map4d.Circle(option);
285
286
  (_circleRef$current = circleRef.current) === null || _circleRef$current === void 0 ? void 0 : _circleRef$current.setMap(theMap);
286
287
  onCreated && onCreated(circleRef.current);
288
+ circleRef.current.onClick = onClick;
287
289
  }
288
290
  }, [theMap]);
291
+ React.useEffect(function () {
292
+ if (circleRef.current) {
293
+ circleRef.current.onClick = onClick;
294
+ }
295
+ }, [onClick]);
289
296
  React.useEffect(function () {
290
297
  if (theMap) {
291
298
  var _circleRef$current2;
@@ -377,12 +384,12 @@ var MFCircle = function MFCircle(props) {
377
384
  }
378
385
  }, [elevation]);
379
386
  React.useEffect(function () {
380
- if (VariableTool.hasValue(clickable)) {
387
+ if (VariableTool.hasValue(userInteractionEnabled)) {
381
388
  var _circleRef$current15;
382
389
 
383
- (_circleRef$current15 = circleRef.current) === null || _circleRef$current15 === void 0 ? void 0 : _circleRef$current15.setClickable(clickable);
390
+ (_circleRef$current15 = circleRef.current) === null || _circleRef$current15 === void 0 ? void 0 : _circleRef$current15.setUserInteraction(userInteractionEnabled);
384
391
  }
385
- }, [clickable]);
392
+ }, [userInteractionEnabled]);
386
393
  return null;
387
394
  };
388
395
 
@@ -486,12 +493,6 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
486
493
  directionRef.current.onMouseMove = onMouseMove;
487
494
  onCreated && onCreated(directionRef.current);
488
495
  }
489
-
490
- return function () {
491
- var _directionRef$current2;
492
-
493
- (_directionRef$current2 = directionRef.current) === null || _directionRef$current2 === void 0 ? void 0 : _directionRef$current2.setMap(null);
494
- };
495
496
  }, [theMap]);
496
497
  React.useEffect(function () {
497
498
  if (directionRef.current) {
@@ -515,46 +516,46 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
515
516
  }, [onMouseMove]);
516
517
  React.useEffect(function () {
517
518
  if (theMap) {
518
- var _directionRef$current3;
519
+ var _directionRef$current2;
519
520
 
520
- (_directionRef$current3 = directionRef.current) === null || _directionRef$current3 === void 0 ? void 0 : _directionRef$current3.setMap(theMap);
521
+ (_directionRef$current2 = directionRef.current) === null || _directionRef$current2 === void 0 ? void 0 : _directionRef$current2.setMap(theMap);
521
522
  }
522
523
 
523
524
  return function () {
524
- var _directionRef$current4;
525
+ var _directionRef$current3;
525
526
 
526
- (_directionRef$current4 = directionRef.current) === null || _directionRef$current4 === void 0 ? void 0 : _directionRef$current4.setMap(null);
527
+ (_directionRef$current3 = directionRef.current) === null || _directionRef$current3 === void 0 ? void 0 : _directionRef$current3.setMap(null);
527
528
  };
528
529
  }, [theMap]);
529
530
  React.useEffect(function () {
530
531
  return function () {
531
- var _directionRef$current5;
532
+ var _directionRef$current4;
532
533
 
533
- (_directionRef$current5 = directionRef.current) === null || _directionRef$current5 === void 0 ? void 0 : _directionRef$current5.setMap(null);
534
+ (_directionRef$current4 = directionRef.current) === null || _directionRef$current4 === void 0 ? void 0 : _directionRef$current4.setMap(null);
534
535
  };
535
536
  }, []);
536
537
  React.useEffect(function () {
537
- var _directionRef$current6;
538
+ var _directionRef$current5;
538
539
 
539
- routes != undefined && ((_directionRef$current6 = directionRef.current) === null || _directionRef$current6 === void 0 ? void 0 : _directionRef$current6.setRoutes(routes));
540
+ routes != undefined && ((_directionRef$current5 = directionRef.current) === null || _directionRef$current5 === void 0 ? void 0 : _directionRef$current5.setRoutes(routes));
540
541
  }, [routes]);
541
542
  React.useEffect(function () {
542
- var _directionRef$current7;
543
+ var _directionRef$current6;
543
544
 
544
- activedIndex != undefined && ((_directionRef$current7 = directionRef.current) === null || _directionRef$current7 === void 0 ? void 0 : _directionRef$current7.setActivedIndex(activedIndex));
545
+ activedIndex != undefined && ((_directionRef$current6 = directionRef.current) === null || _directionRef$current6 === void 0 ? void 0 : _directionRef$current6.setActivedIndex(activedIndex));
545
546
  }, [activedIndex]);
546
547
  React.useEffect(function () {
547
- var _directionRef$current8;
548
+ var _directionRef$current7;
548
549
 
549
- activeStrokePattern != undefined && ((_directionRef$current8 = directionRef.current) === null || _directionRef$current8 === void 0 ? void 0 : _directionRef$current8.setActiveStrokePattern(activeStrokePattern));
550
+ activeStrokePattern != undefined && ((_directionRef$current7 = directionRef.current) === null || _directionRef$current7 === void 0 ? void 0 : _directionRef$current7.setActiveStrokePattern(activeStrokePattern));
550
551
  }, [activeStrokePattern]);
551
552
  React.useEffect(function () {
552
- var _directionRef$current9;
553
+ var _directionRef$current8;
553
554
 
554
- inactiveStrokePattern != undefined && ((_directionRef$current9 = directionRef.current) === null || _directionRef$current9 === void 0 ? void 0 : _directionRef$current9.setInactiveStrokePattern(inactiveStrokePattern));
555
+ inactiveStrokePattern != undefined && ((_directionRef$current8 = directionRef.current) === null || _directionRef$current8 === void 0 ? void 0 : _directionRef$current8.setInactiveStrokePattern(inactiveStrokePattern));
555
556
  }, [inactiveStrokePattern]);
556
557
  React.useEffect(function () {
557
- var _directionRef$current10;
558
+ var _directionRef$current9;
558
559
 
559
560
  var option = {
560
561
  routes: routes,
@@ -579,7 +580,7 @@ var MFDirectionsRenderer = function MFDirectionsRenderer(props) {
579
580
  delete option[key];
580
581
  }
581
582
  });
582
- (_directionRef$current10 = directionRef.current) === null || _directionRef$current10 === void 0 ? void 0 : _directionRef$current10.setOptions(option);
583
+ (_directionRef$current9 = directionRef.current) === null || _directionRef$current9 === void 0 ? void 0 : _directionRef$current9.setOptions(option);
583
584
  }, [activeStrokeWidth, activeStrokeColor, activeOutlineWidth, activeOutlineColor, inactiveStrokeColor, inactiveOutlineWidth, inactiveOutlineColor, originMarkerOptions, destinationMarkerOptions, waypointMarkerOptions, onMarkerDragEnd]);
584
585
  return null;
585
586
  };
@@ -770,7 +771,14 @@ var createId = function createId() {
770
771
  };
771
772
 
772
773
  var MFMap = function MFMap(props) {
773
- var _props$options3, _props$options8;
774
+ var _options = React.useRef({
775
+ options: props.options,
776
+ mapId: props.mapid,
777
+ version: props.version,
778
+ environment: props.environment,
779
+ accessKey: props.accessKey,
780
+ sdkDomain: props.sdkDomain
781
+ });
774
782
 
775
783
  var callback = React.useRef("callback");
776
784
  var mapDomRef = React.useRef();
@@ -778,19 +786,45 @@ var MFMap = function MFMap(props) {
778
786
  var scriptElement = React.useRef();
779
787
  var url = React.useRef();
780
788
  var events = React.useRef([]);
789
+ var zoom = props.zoom,
790
+ bearing = props.bearing,
791
+ center = props.center,
792
+ tilt = props.tilt;
781
793
 
782
794
  var _useState = React.useState(),
783
795
  map = _useState[0],
784
796
  setMap = _useState[1];
785
797
 
798
+ React.useEffect(function () {
799
+ if (map) {
800
+ var camera = map.getCamera();
801
+
802
+ if (zoom != undefined && zoom != null) {
803
+ camera.setZoom(zoom);
804
+ }
805
+
806
+ if (bearing != undefined && bearing != null) {
807
+ camera.setBearing(bearing);
808
+ }
809
+
810
+ if (center != undefined && center != null) {
811
+ camera.setTarget(center);
812
+ }
813
+
814
+ if (tilt != undefined && tilt != null) {
815
+ camera.setTilt(center);
816
+ }
817
+
818
+ map.moveCamera(camera);
819
+ }
820
+ }, [zoom, bearing, center, map]);
786
821
  React.useEffect(function () {
787
822
  var id = createId();
788
823
  callback.current = "callback_" + id;
789
824
 
790
825
  var createCallback = function createCallback() {
791
826
  window[callback.current] = function () {
792
- var options = props.options;
793
- mapRef.current = new window.map4d.Map(mapDomRef.current, options);
827
+ mapRef.current = new window.map4d.Map(mapDomRef.current, _options.current.options);
794
828
 
795
829
  if (props.onMapReady) {
796
830
  props.onMapReady(mapRef.current, id);
@@ -801,16 +835,16 @@ var MFMap = function MFMap(props) {
801
835
  };
802
836
  };
803
837
 
804
- var domain = "https://api" + (props.environment ? "-" + props.environment : "") + ".map4d.vn";
838
+ var domain = "https://api" + (props.environment ? "-" + _options.current.environment : "") + ".map4d.vn";
805
839
 
806
- if (props.sdkDomain) {
807
- domain = props.sdkDomain;
840
+ if (_options.current.sdkDomain) {
841
+ domain = _options.current.sdkDomain;
808
842
  }
809
843
 
810
- var urlNew = domain + "/sdk/map/js?version=" + props.version + "&key=" + props.accessKey + "&callback=" + callback.current;
844
+ var urlNew = domain + "/sdk/map/js?version=" + _options.current.version + "&key=" + _options.current.accessKey + "&callback=" + callback.current;
811
845
 
812
- if (props.mapid) {
813
- urlNew += "&mapId=" + props.mapid;
846
+ if (_options.current.mapId) {
847
+ urlNew += "&mapId=" + _options.current.mapId;
814
848
  }
815
849
 
816
850
  createCallback();
@@ -840,168 +874,156 @@ var MFMap = function MFMap(props) {
840
874
 
841
875
  destroy();
842
876
  };
843
- }, [props.environment, props.version, props.accessKey]);
844
- React.useEffect(function () {
845
- var _props$options, _mapRef$current2, _props$options2;
846
-
847
- ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.mapType) != undefined && ((_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.setMapType((_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _props$options2.mapType));
848
- }, [(_props$options3 = props.options) === null || _props$options3 === void 0 ? void 0 : _props$options3.mapType]);
849
- React.useEffect(function () {
850
- var _props$options4, _props$options6, _mapRef$current5, _props$options7;
851
-
852
- if (((_props$options4 = props.options) === null || _props$options4 === void 0 ? void 0 : _props$options4.center) != undefined) {
853
- var _mapRef$current3, _props$options5, _mapRef$current4;
854
-
855
- var camera = (_mapRef$current3 = mapRef.current) === null || _mapRef$current3 === void 0 ? void 0 : _mapRef$current3.getCamera();
856
- camera === null || camera === void 0 ? void 0 : camera.setTarget((_props$options5 = props.options) === null || _props$options5 === void 0 ? void 0 : _props$options5.center);
857
- (_mapRef$current4 = mapRef.current) === null || _mapRef$current4 === void 0 ? void 0 : _mapRef$current4.moveCamera(camera);
858
- }
859
-
860
- ((_props$options6 = props.options) === null || _props$options6 === void 0 ? void 0 : _props$options6.mapType) != undefined && ((_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.setMapType((_props$options7 = props.options) === null || _props$options7 === void 0 ? void 0 : _props$options7.mapType));
861
- }, [(_props$options8 = props.options) === null || _props$options8 === void 0 ? void 0 : _props$options8.center]);
877
+ }, []);
862
878
 
863
879
  var registerEvent = function registerEvent() {
864
- var _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, _mapRef$current19, _mapRef$current20, _mapRef$current21, _mapRef$current22, _mapRef$current23, _mapRef$current24;
880
+ 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, _mapRef$current19, _mapRef$current20, _mapRef$current21;
865
881
 
866
- var eventClickMarker = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("click", function (args) {
882
+ var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
867
883
  var _args$marker, _args$marker2;
868
884
 
869
885
  ((_args$marker = args.marker) === null || _args$marker === void 0 ? void 0 : _args$marker.onClick) && ((_args$marker2 = args.marker) === null || _args$marker2 === void 0 ? void 0 : _args$marker2.onClick(args));
870
886
  }, {
871
887
  marker: true
872
888
  });
873
- var eventRightClickMarker = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("rightClick", function (args) {
889
+ var eventRightClickMarker = (_mapRef$current3 = mapRef.current) === null || _mapRef$current3 === void 0 ? void 0 : _mapRef$current3.addListener("rightClick", function (args) {
874
890
  var _args$marker3, _args$marker4;
875
891
 
876
892
  ((_args$marker3 = args.marker) === null || _args$marker3 === void 0 ? void 0 : _args$marker3.onRightClick) && ((_args$marker4 = args.marker) === null || _args$marker4 === void 0 ? void 0 : _args$marker4.onRightClick(args));
877
893
  }, {
878
894
  marker: true
879
895
  });
880
- var eventDragEndMarker = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("dragEnd", function (args) {
896
+ var eventDragEndMarker = (_mapRef$current4 = mapRef.current) === null || _mapRef$current4 === void 0 ? void 0 : _mapRef$current4.addListener("dragEnd", function (args) {
881
897
  var _args$marker5, _args$marker6;
882
898
 
883
899
  ((_args$marker5 = args.marker) === null || _args$marker5 === void 0 ? void 0 : _args$marker5.onDragEnd) && ((_args$marker6 = args.marker) === null || _args$marker6 === void 0 ? void 0 : _args$marker6.onDragEnd(args));
884
900
  }, {
885
901
  marker: true
886
902
  });
887
- var eventHoverMarker = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("hover", function (args) {
903
+ var eventHoverMarker = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("hover", function (args) {
888
904
  var _args$marker7, _args$marker8;
889
905
 
890
906
  ((_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(args));
891
907
  }, {
892
908
  marker: true
893
909
  });
894
- var eventHoverPolygon = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("hover", function (args) {
910
+ var eventHoverPolygon = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("hover", function (args) {
895
911
  var _args$polygon, _args$polygon2;
896
912
 
897
913
  ((_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(args));
898
914
  }, {
899
915
  polygon: true
900
916
  });
901
- var eventHoverPolyline = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("hover", function (args) {
917
+ var eventHoverPolyline = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("hover", function (args) {
902
918
  var _args$polyline, _args$polyline2;
903
919
 
904
920
  ((_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(args));
905
921
  }, {
906
922
  polyline: true
907
923
  });
908
- var eventHoverDirection = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("hover", function (args) {
924
+ var eventHoverDirection = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("hover", function (args) {
909
925
  var _args$renderer, _args$renderer2;
910
926
 
911
927
  ((_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(args));
912
928
  }, {
913
929
  directions: true
914
930
  });
915
- var eventClickPolyline = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("click", function (args) {
931
+ var eventClickPolyline = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("click", function (args) {
916
932
  var _args$polyline3, _args$polyline4;
917
933
 
918
934
  ((_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(args));
919
935
  }, {
920
936
  polyline: true
921
937
  });
922
- var eventMouseOutDirection = (_mapRef$current14 = mapRef.current) === null || _mapRef$current14 === void 0 ? void 0 : _mapRef$current14.addListener("mouseOut", function (args) {
938
+ var eventMouseOutDirection = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("mouseOut", function (args) {
923
939
  var _args$renderer3, _args$renderer4;
924
940
 
925
941
  ((_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(args));
926
942
  }, {
927
943
  directions: true
928
944
  });
929
- var eventMouseOverDirection = (_mapRef$current15 = mapRef.current) === null || _mapRef$current15 === void 0 ? void 0 : _mapRef$current15.addListener("mouseOver", function (args) {
945
+ var eventMouseOverDirection = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("mouseOver", function (args) {
930
946
  var _args$renderer5, _args$renderer6;
931
947
 
932
948
  ((_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(args));
933
949
  }, {
934
950
  directions: true
935
951
  });
936
- var eventMouseMoveDirection = (_mapRef$current16 = mapRef.current) === null || _mapRef$current16 === void 0 ? void 0 : _mapRef$current16.addListener("mouseMove", function (args) {
952
+ var eventMouseMoveDirection = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("mouseMove", function (args) {
937
953
  var _args$renderer7, _args$renderer8;
938
954
 
939
955
  ((_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(args));
940
956
  }, {
941
957
  directions: true
942
958
  });
943
- var eventMouseOutPolyline = (_mapRef$current17 = mapRef.current) === null || _mapRef$current17 === void 0 ? void 0 : _mapRef$current17.addListener("mouseOut", function (args) {
959
+ var eventMouseOutPolyline = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("mouseOut", function (args) {
944
960
  var _args$polyline5, _args$polyline6;
945
961
 
946
962
  ((_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(args));
947
963
  }, {
948
964
  polyline: true
949
965
  });
950
- var eventMouseOverPolyline = (_mapRef$current18 = mapRef.current) === null || _mapRef$current18 === void 0 ? void 0 : _mapRef$current18.addListener("mouseOver", function (args) {
966
+ var eventMouseOverPolyline = (_mapRef$current14 = mapRef.current) === null || _mapRef$current14 === void 0 ? void 0 : _mapRef$current14.addListener("mouseOver", function (args) {
951
967
  var _args$polyline7, _args$polyline8;
952
968
 
953
969
  ((_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(args));
954
970
  }, {
955
971
  polyline: true
956
972
  });
957
- var eventMouseMovePolyline = (_mapRef$current19 = mapRef.current) === null || _mapRef$current19 === void 0 ? void 0 : _mapRef$current19.addListener("mouseMove", function (args) {
973
+ var eventMouseMovePolyline = (_mapRef$current15 = mapRef.current) === null || _mapRef$current15 === void 0 ? void 0 : _mapRef$current15.addListener("mouseMove", function (args) {
958
974
  var _args$polyline9, _args$polyline10;
959
975
 
960
976
  ((_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(args));
961
977
  }, {
962
978
  polyline: true
963
979
  });
964
- var eventMouseOutMarker = (_mapRef$current20 = mapRef.current) === null || _mapRef$current20 === void 0 ? void 0 : _mapRef$current20.addListener("mouseOut", function (args) {
980
+ var eventMouseOutMarker = (_mapRef$current16 = mapRef.current) === null || _mapRef$current16 === void 0 ? void 0 : _mapRef$current16.addListener("mouseOut", function (args) {
965
981
  var _args$marker9, _args$marker10;
966
982
 
967
983
  ((_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(args));
968
984
  }, {
969
985
  marker: true
970
986
  });
971
- var eventMouseOverMarker = (_mapRef$current21 = mapRef.current) === null || _mapRef$current21 === void 0 ? void 0 : _mapRef$current21.addListener("mouseOver", function (args) {
987
+ var eventMouseOverMarker = (_mapRef$current17 = mapRef.current) === null || _mapRef$current17 === void 0 ? void 0 : _mapRef$current17.addListener("mouseOver", function (args) {
972
988
  var _args$marker11, _args$marker12;
973
989
 
974
990
  ((_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(args));
975
991
  }, {
976
992
  marker: true
977
993
  });
978
- var eventMouseMoveMarker = (_mapRef$current22 = mapRef.current) === null || _mapRef$current22 === void 0 ? void 0 : _mapRef$current22.addListener("mouseMove", function (args) {
994
+ var eventMouseMoveMarker = (_mapRef$current18 = mapRef.current) === null || _mapRef$current18 === void 0 ? void 0 : _mapRef$current18.addListener("mouseMove", function (args) {
979
995
  var _args$marker13, _args$marker14;
980
996
 
981
997
  ((_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(args));
982
998
  }, {
983
999
  marker: true
984
1000
  });
985
- var eventClickPoi = (_mapRef$current23 = mapRef.current) === null || _mapRef$current23 === void 0 ? void 0 : _mapRef$current23.addListener("click", function (args) {
1001
+ var eventClickPoi = (_mapRef$current19 = mapRef.current) === null || _mapRef$current19 === void 0 ? void 0 : _mapRef$current19.addListener("click", function (args) {
986
1002
  var _args$poi, _args$poi2;
987
1003
 
988
1004
  ((_args$poi = args.poi) === null || _args$poi === void 0 ? void 0 : _args$poi.onClick) && ((_args$poi2 = args.poi) === null || _args$poi2 === void 0 ? void 0 : _args$poi2.onClick(args));
989
1005
  }, {
990
1006
  poi: true
991
1007
  });
992
- var eventHoverPoi = (_mapRef$current24 = mapRef.current) === null || _mapRef$current24 === void 0 ? void 0 : _mapRef$current24.addListener("hover", function (args) {
1008
+ var eventHoverPoi = (_mapRef$current20 = mapRef.current) === null || _mapRef$current20 === void 0 ? void 0 : _mapRef$current20.addListener("hover", function (args) {
993
1009
  var _args$poi3, _args$poi4;
994
1010
 
995
1011
  ((_args$poi3 = args.poi) === null || _args$poi3 === void 0 ? void 0 : _args$poi3.onHover) && ((_args$poi4 = args.poi) === null || _args$poi4 === void 0 ? void 0 : _args$poi4.onHover(args));
996
1012
  }, {
997
1013
  poi: true
998
1014
  });
999
- events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline, eventMouseOutDirection, eventMouseOverDirection, eventMouseMoveDirection, eventMouseOutPolyline, eventMouseOverPolyline, eventMouseMovePolyline, eventMouseOutMarker, eventMouseOverMarker, eventMouseMoveMarker, eventClickPoi, eventHoverPoi]);
1015
+ events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline, eventMouseOutDirection, eventMouseOverDirection, eventMouseMoveDirection, eventMouseOutPolyline, eventMouseOverPolyline, eventMouseMovePolyline, eventMouseOutMarker, eventMouseOverMarker, eventMouseMoveMarker, eventClickPoi, eventHoverPoi, (_mapRef$current21 = mapRef.current) === null || _mapRef$current21 === void 0 ? void 0 : _mapRef$current21.addListener("click", function (args) {
1016
+ var _args$circle, _args$circle2;
1017
+
1018
+ ((_args$circle = args.circle) === null || _args$circle === void 0 ? void 0 : _args$circle.onClick) && ((_args$circle2 = args.circle) === null || _args$circle2 === void 0 ? void 0 : _args$circle2.onClick(args));
1019
+ }, {
1020
+ circle: true
1021
+ })]);
1000
1022
 
1001
1023
  if (props.onClickLocation) {
1002
- var _mapRef$current25;
1024
+ var _mapRef$current22;
1003
1025
 
1004
- var onClickLocation = (_mapRef$current25 = mapRef.current) === null || _mapRef$current25 === void 0 ? void 0 : _mapRef$current25.addListener("click", function (args) {
1026
+ var onClickLocation = (_mapRef$current22 = mapRef.current) === null || _mapRef$current22 === void 0 ? void 0 : _mapRef$current22.addListener("click", function (args) {
1005
1027
  props.onClickLocation && props.onClickLocation(args);
1006
1028
  }, {
1007
1029
  location: true
@@ -1010,9 +1032,9 @@ var MFMap = function MFMap(props) {
1010
1032
  }
1011
1033
 
1012
1034
  if (props.onRightClickLocation) {
1013
- var _mapRef$current26;
1035
+ var _mapRef$current23;
1014
1036
 
1015
- var onRightClickLocation = (_mapRef$current26 = mapRef.current) === null || _mapRef$current26 === void 0 ? void 0 : _mapRef$current26.addListener("rightClick", function (args) {
1037
+ var onRightClickLocation = (_mapRef$current23 = mapRef.current) === null || _mapRef$current23 === void 0 ? void 0 : _mapRef$current23.addListener("rightClick", function (args) {
1016
1038
  props.onRightClickLocation && props.onRightClickLocation(args);
1017
1039
  }, {
1018
1040
  location: true
@@ -1021,9 +1043,9 @@ var MFMap = function MFMap(props) {
1021
1043
  }
1022
1044
 
1023
1045
  if (props.onTilesLoaded) {
1024
- var _mapRef$current27;
1046
+ var _mapRef$current24;
1025
1047
 
1026
- var onTilesLoaded = (_mapRef$current27 = mapRef.current) === null || _mapRef$current27 === void 0 ? void 0 : _mapRef$current27.addListener("tilesLoaded", function (args) {
1048
+ var onTilesLoaded = (_mapRef$current24 = mapRef.current) === null || _mapRef$current24 === void 0 ? void 0 : _mapRef$current24.addListener("tilesLoaded", function (args) {
1027
1049
  props.onTilesLoaded && props.onTilesLoaded(args);
1028
1050
  }, {
1029
1051
  location: true
@@ -1032,9 +1054,9 @@ var MFMap = function MFMap(props) {
1032
1054
  }
1033
1055
 
1034
1056
  if (props.onCameraChanging) {
1035
- var _mapRef$current28;
1057
+ var _mapRef$current25;
1036
1058
 
1037
- var onCameraChanging = (_mapRef$current28 = mapRef.current) === null || _mapRef$current28 === void 0 ? void 0 : _mapRef$current28.addListener("cameraChanging", function (args) {
1059
+ var onCameraChanging = (_mapRef$current25 = mapRef.current) === null || _mapRef$current25 === void 0 ? void 0 : _mapRef$current25.addListener("cameraChanging", function (args) {
1038
1060
  props.onCameraChanging && props.onCameraChanging(args);
1039
1061
  }, {
1040
1062
  location: true
@@ -1074,7 +1096,7 @@ var MFMarker = function MFMarker(props) {
1074
1096
  label = props.label,
1075
1097
  draggable = props.draggable,
1076
1098
  iconView = props.iconView,
1077
- clickable = props.clickable,
1099
+ userInteractionEnabled = props.userInteractionEnabled,
1078
1100
  map = props.map,
1079
1101
  onCreated = props.onCreated,
1080
1102
  onClick = props.onClick,
@@ -1107,7 +1129,7 @@ var MFMarker = function MFMarker(props) {
1107
1129
  label: label,
1108
1130
  draggable: draggable,
1109
1131
  iconView: iconView,
1110
- clickable: clickable
1132
+ userInteractionEnabled: userInteractionEnabled
1111
1133
  };
1112
1134
  Object.keys(option).forEach(function (key) {
1113
1135
  if (option[key] == undefined || option[key] == null) {
@@ -1287,8 +1309,8 @@ var MFMarker = function MFMarker(props) {
1287
1309
  React.useEffect(function () {
1288
1310
  var _markerRef$current20;
1289
1311
 
1290
- clickable != undefined && ((_markerRef$current20 = markerRef.current) === null || _markerRef$current20 === void 0 ? void 0 : _markerRef$current20.setClickable(clickable));
1291
- }, [clickable]);
1312
+ userInteractionEnabled != undefined && ((_markerRef$current20 = markerRef.current) === null || _markerRef$current20 === void 0 ? void 0 : _markerRef$current20.setUserInteraction(userInteractionEnabled));
1313
+ }, [userInteractionEnabled]);
1292
1314
  React.useEffect(function () {
1293
1315
  var _markerRef$current21;
1294
1316
 
@@ -1418,7 +1440,7 @@ var MFPOI = function MFPOI(props) {
1418
1440
  zIndex = props.zIndex,
1419
1441
  visible = props.visible,
1420
1442
  draggable = props.draggable,
1421
- clickable = props.clickable,
1443
+ userInteractionEnabled = props.userInteractionEnabled,
1422
1444
  map = props.map,
1423
1445
  onCreated = props.onCreated,
1424
1446
  onClick = props.onClick,
@@ -1444,7 +1466,7 @@ var MFPOI = function MFPOI(props) {
1444
1466
  zIndex: zIndex,
1445
1467
  visible: visible,
1446
1468
  draggable: draggable,
1447
- clickable: clickable
1469
+ userInteractionEnabled: userInteractionEnabled
1448
1470
  };
1449
1471
  Object.keys(option).forEach(function (key) {
1450
1472
  if (option[key] == undefined || option[key] == null) {
@@ -1531,8 +1553,8 @@ var MFPOI = function MFPOI(props) {
1531
1553
  React.useEffect(function () {
1532
1554
  var _poiRef$current15;
1533
1555
 
1534
- clickable != undefined && ((_poiRef$current15 = poiRef.current) === null || _poiRef$current15 === void 0 ? void 0 : _poiRef$current15.setClickable(clickable));
1535
- }, [clickable]);
1556
+ userInteractionEnabled != undefined && ((_poiRef$current15 = poiRef.current) === null || _poiRef$current15 === void 0 ? void 0 : _poiRef$current15.setUserInteraction(userInteractionEnabled));
1557
+ }, [userInteractionEnabled]);
1536
1558
  React.useEffect(function () {
1537
1559
  if (poiRef.current) {
1538
1560
  poiRef.current.onClick = onClick;
@@ -1625,14 +1647,13 @@ var MFPolygon = function MFPolygon(props) {
1625
1647
  draggable = props.draggable,
1626
1648
  elevation = props.elevation,
1627
1649
  zIndex = props.zIndex,
1628
- clickable = props.clickable,
1650
+ userInteractionEnabled = props.userInteractionEnabled,
1629
1651
  map = props.map,
1630
1652
  onHover = props.onHover,
1631
1653
  onCreated = props.onCreated;
1632
1654
  var map4dContext = React.useContext(Map4dContext);
1633
1655
  var theMap = map || map4dContext.map;
1634
1656
  var polygonRef = React.useRef();
1635
- var a = React.useRef();
1636
1657
  React.useEffect(function () {
1637
1658
  if (theMap && !polygonRef.current) {
1638
1659
  var _polygonRef$current;
@@ -1647,7 +1668,7 @@ var MFPolygon = function MFPolygon(props) {
1647
1668
  draggable: draggable,
1648
1669
  elevation: elevation,
1649
1670
  zIndex: zIndex,
1650
- clickable: clickable
1671
+ userInteractionEnabled: userInteractionEnabled
1651
1672
  };
1652
1673
  Object.keys(option).forEach(function (key) {
1653
1674
  if (option[key] == undefined || option[key] == null) {
@@ -1655,8 +1676,6 @@ var MFPolygon = function MFPolygon(props) {
1655
1676
  }
1656
1677
  });
1657
1678
  polygonRef.current = new map4d.Polygon(option);
1658
- a.current = theMap;
1659
- console.log(a.current);
1660
1679
  (_polygonRef$current = polygonRef.current) === null || _polygonRef$current === void 0 ? void 0 : _polygonRef$current.setMap(theMap);
1661
1680
  polygonRef.current.onHover = props.onHover;
1662
1681
  onCreated && onCreated(polygonRef.current);
@@ -1688,62 +1707,55 @@ var MFPolygon = function MFPolygon(props) {
1688
1707
  }
1689
1708
  }, [onHover]);
1690
1709
  React.useEffect(function () {
1691
- var _polygonRef$current6;
1692
-
1693
- if (polygonRef.current) {
1694
- var _polygonRef$current5;
1695
-
1696
- var c = (_polygonRef$current5 = polygonRef.current) === null || _polygonRef$current5 === void 0 ? void 0 : _polygonRef$current5.getMap();
1697
- console.log(c == a.current);
1698
- }
1710
+ var _polygonRef$current5;
1699
1711
 
1700
- (_polygonRef$current6 = polygonRef.current) === null || _polygonRef$current6 === void 0 ? void 0 : _polygonRef$current6.setPaths(paths);
1712
+ (_polygonRef$current5 = polygonRef.current) === null || _polygonRef$current5 === void 0 ? void 0 : _polygonRef$current5.setPaths(paths);
1701
1713
  }, [paths]);
1702
1714
  React.useEffect(function () {
1703
- var _polygonRef$current7;
1715
+ var _polygonRef$current6;
1704
1716
 
1705
- fillColor != undefined && ((_polygonRef$current7 = polygonRef.current) === null || _polygonRef$current7 === void 0 ? void 0 : _polygonRef$current7.setFillColor(fillColor));
1717
+ fillColor != undefined && ((_polygonRef$current6 = polygonRef.current) === null || _polygonRef$current6 === void 0 ? void 0 : _polygonRef$current6.setFillColor(fillColor));
1706
1718
  }, [fillColor]);
1707
1719
  React.useEffect(function () {
1708
- var _polygonRef$current8;
1720
+ var _polygonRef$current7;
1709
1721
 
1710
- fillOpacity != undefined && ((_polygonRef$current8 = polygonRef.current) === null || _polygonRef$current8 === void 0 ? void 0 : _polygonRef$current8.setFillOpacity(fillOpacity));
1722
+ fillOpacity != undefined && ((_polygonRef$current7 = polygonRef.current) === null || _polygonRef$current7 === void 0 ? void 0 : _polygonRef$current7.setFillOpacity(fillOpacity));
1711
1723
  }, [fillOpacity]);
1712
1724
  React.useEffect(function () {
1713
- var _polygonRef$current9;
1725
+ var _polygonRef$current8;
1714
1726
 
1715
- (_polygonRef$current9 = polygonRef.current) === null || _polygonRef$current9 === void 0 ? void 0 : _polygonRef$current9.setVisible(visible);
1727
+ (_polygonRef$current8 = polygonRef.current) === null || _polygonRef$current8 === void 0 ? void 0 : _polygonRef$current8.setVisible(visible);
1716
1728
  }, [visible]);
1717
1729
  React.useEffect(function () {
1718
- var _polygonRef$current10;
1730
+ var _polygonRef$current9;
1719
1731
 
1720
- strokeColor != undefined && ((_polygonRef$current10 = polygonRef.current) === null || _polygonRef$current10 === void 0 ? void 0 : _polygonRef$current10.setStrokeColor(strokeColor));
1732
+ strokeColor != undefined && ((_polygonRef$current9 = polygonRef.current) === null || _polygonRef$current9 === void 0 ? void 0 : _polygonRef$current9.setStrokeColor(strokeColor));
1721
1733
  }, [strokeColor]);
1722
1734
  React.useEffect(function () {
1723
- var _polygonRef$current11;
1735
+ var _polygonRef$current10;
1724
1736
 
1725
- strokeWidth != undefined && ((_polygonRef$current11 = polygonRef.current) === null || _polygonRef$current11 === void 0 ? void 0 : _polygonRef$current11.setStrokeWidth(strokeWidth));
1737
+ strokeWidth != undefined && ((_polygonRef$current10 = polygonRef.current) === null || _polygonRef$current10 === void 0 ? void 0 : _polygonRef$current10.setStrokeWidth(strokeWidth));
1726
1738
  }, [strokeWidth]);
1727
1739
  React.useEffect(function () {
1728
- var _polygonRef$current12;
1740
+ var _polygonRef$current11;
1729
1741
 
1730
- draggable != undefined && ((_polygonRef$current12 = polygonRef.current) === null || _polygonRef$current12 === void 0 ? void 0 : _polygonRef$current12.setDraggable(draggable));
1742
+ draggable != undefined && ((_polygonRef$current11 = polygonRef.current) === null || _polygonRef$current11 === void 0 ? void 0 : _polygonRef$current11.setDraggable(draggable));
1731
1743
  }, [draggable]);
1732
1744
  React.useEffect(function () {
1733
- var _polygonRef$current13;
1745
+ var _polygonRef$current12;
1734
1746
 
1735
- elevation != undefined && ((_polygonRef$current13 = polygonRef.current) === null || _polygonRef$current13 === void 0 ? void 0 : _polygonRef$current13.setElevation(elevation));
1747
+ elevation != undefined && ((_polygonRef$current12 = polygonRef.current) === null || _polygonRef$current12 === void 0 ? void 0 : _polygonRef$current12.setElevation(elevation));
1736
1748
  }, [elevation]);
1737
1749
  React.useEffect(function () {
1738
- var _polygonRef$current14;
1750
+ var _polygonRef$current13;
1739
1751
 
1740
- zIndex != undefined && ((_polygonRef$current14 = polygonRef.current) === null || _polygonRef$current14 === void 0 ? void 0 : _polygonRef$current14.setZIndex(zIndex));
1752
+ zIndex != undefined && ((_polygonRef$current13 = polygonRef.current) === null || _polygonRef$current13 === void 0 ? void 0 : _polygonRef$current13.setZIndex(zIndex));
1741
1753
  }, [zIndex]);
1742
1754
  React.useEffect(function () {
1743
- var _polygonRef$current15;
1755
+ var _polygonRef$current14;
1744
1756
 
1745
- clickable != undefined && ((_polygonRef$current15 = polygonRef.current) === null || _polygonRef$current15 === void 0 ? void 0 : _polygonRef$current15.setClickable(clickable));
1746
- }, [clickable]);
1757
+ userInteractionEnabled != undefined && ((_polygonRef$current14 = polygonRef.current) === null || _polygonRef$current14 === void 0 ? void 0 : _polygonRef$current14.setUserInteraction(userInteractionEnabled));
1758
+ }, [userInteractionEnabled]);
1747
1759
  return null;
1748
1760
  };
1749
1761
 
@@ -1759,7 +1771,7 @@ var MFPolyline = function MFPolyline(props) {
1759
1771
  zIndex = props.zIndex,
1760
1772
  elevation = props.elevation,
1761
1773
  strokePattern = props.strokePattern,
1762
- clickable = props.clickable,
1774
+ userInteractionEnabled = props.userInteractionEnabled,
1763
1775
  map = props.map,
1764
1776
  onClick = props.onClick,
1765
1777
  onHover = props.onHover,
@@ -1788,7 +1800,7 @@ var MFPolyline = function MFPolyline(props) {
1788
1800
  zIndex: zIndex,
1789
1801
  elevation: elevation,
1790
1802
  strokePattern: strokePattern,
1791
- clickable: clickable
1803
+ userInteractionEnabled: userInteractionEnabled
1792
1804
  };
1793
1805
  Object.keys(option).forEach(function (key) {
1794
1806
  if (option[key] == undefined || option[key] == null) {
@@ -1903,8 +1915,8 @@ var MFPolyline = function MFPolyline(props) {
1903
1915
  React.useEffect(function () {
1904
1916
  var _polylineRef$current15;
1905
1917
 
1906
- clickable != undefined && ((_polylineRef$current15 = polylineRef.current) === null || _polylineRef$current15 === void 0 ? void 0 : _polylineRef$current15.setClickable(clickable));
1907
- }, [clickable]);
1918
+ userInteractionEnabled != undefined && ((_polylineRef$current15 = polylineRef.current) === null || _polylineRef$current15 === void 0 ? void 0 : _polylineRef$current15.setUserInteraction(userInteractionEnabled));
1919
+ }, [userInteractionEnabled]);
1908
1920
  return null;
1909
1921
  };
1910
1922