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