react-map4d-map 1.2.6 → 1.2.8

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.
@@ -17,5 +17,5 @@ interface BuildingProps {
17
17
  map?: map4d.Map;
18
18
  onCreated?: (building: map4d.Building) => void;
19
19
  }
20
- declare const MFBuilding: (props: BuildingProps) => null;
20
+ declare const MFBuilding: (props: BuildingProps) => any;
21
21
  export default MFBuilding;
@@ -6,5 +6,5 @@ interface BuildingOverlayProps {
6
6
  map?: map4d.Map;
7
7
  onCreated?: (buildingOverlay: map4d.BuildingOverlay) => void;
8
8
  }
9
- declare const MFBuildingOverlay: (props: BuildingOverlayProps) => null;
9
+ declare const MFBuildingOverlay: (props: BuildingOverlayProps) => any;
10
10
  export default MFBuildingOverlay;
@@ -13,5 +13,5 @@ interface CircleProps {
13
13
  map?: map4d.Map;
14
14
  onCreated?: (circle: map4d.Circle) => void;
15
15
  }
16
- declare const MFCircle: (props: CircleProps) => null;
16
+ declare const MFCircle: (props: CircleProps) => any;
17
17
  export default MFCircle;
@@ -3,5 +3,5 @@ interface DataLayerProps {
3
3
  map?: map4d.Map;
4
4
  onCreated?: (dataLeyer?: map4d.Data.Feature[]) => void;
5
5
  }
6
- declare const MFDataLayer: (props: DataLayerProps) => null;
6
+ declare const MFDataLayer: (props: DataLayerProps) => any;
7
7
  export default MFDataLayer;
@@ -27,5 +27,5 @@ interface DirectionsRendererProps {
27
27
  onMouseOver?: (args: any) => void;
28
28
  onMouseMove?: (args: any) => void;
29
29
  }
30
- declare const MFDirectionsRenderer: (props: DirectionsRendererProps) => null;
30
+ declare const MFDirectionsRenderer: (props: DirectionsRendererProps) => any;
31
31
  export default MFDirectionsRenderer;
@@ -2,5 +2,5 @@ interface GroundOverlayProps extends map4d.GroundOverlayOptions {
2
2
  map?: map4d.Map;
3
3
  onCreated?: (groundOverlay: map4d.GroundOverlay) => void;
4
4
  }
5
- declare const MFGroundOverlay: (props: GroundOverlayProps) => null;
5
+ declare const MFGroundOverlay: (props: GroundOverlayProps) => any;
6
6
  export default MFGroundOverlay;
@@ -2,5 +2,5 @@ interface ImageOverlayProps extends map4d.ImageOverlayOptions {
2
2
  map?: map4d.Map;
3
3
  onCreated?: (imageOverlay: map4d.ImageOverlay) => void;
4
4
  }
5
- declare const MFImageOverlay: (props: ImageOverlayProps) => null;
5
+ declare const MFImageOverlay: (props: ImageOverlayProps) => any;
6
6
  export default MFImageOverlay;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare function addLibrary(url: string, id: string): HTMLScriptElement | null;
2
+ export declare function addLibrary(url: string, id: string): HTMLScriptElement;
3
3
  interface MapOptions {
4
4
  center?: any;
5
5
  zoom?: number;
@@ -32,5 +32,5 @@ interface MarkerProps {
32
32
  onMouseOver?: (args: any) => void;
33
33
  onMouseMove?: (args: any) => void;
34
34
  }
35
- declare const MFMarker: (props: MarkerProps) => null;
35
+ declare const MFMarker: (props: MarkerProps) => any;
36
36
  export default MFMarker;
@@ -15,5 +15,5 @@ interface POIProps extends map4d.POIOptions {
15
15
  onClick?: (args: any) => void;
16
16
  onHover?: (args: any) => void;
17
17
  }
18
- declare const MFPOI: (props: POIProps) => null;
18
+ declare const MFPOI: (props: POIProps) => any;
19
19
  export default MFPOI;
@@ -2,5 +2,5 @@ interface POIOverlayProps extends map4d.POIOverlayOptions {
2
2
  map?: map4d.Map;
3
3
  onCreated?: (poiOverlay: map4d.POIOverlay) => void;
4
4
  }
5
- declare const MFPOIOverlay: (props: POIOverlayProps) => null;
5
+ declare const MFPOIOverlay: (props: POIOverlayProps) => any;
6
6
  export default MFPOIOverlay;
@@ -13,5 +13,5 @@ interface PolygonProps {
13
13
  onCreated?: (polygon: map4d.Polygon) => void;
14
14
  onHover?: (args: any) => void;
15
15
  }
16
- declare const MFPolygon: (props: PolygonProps) => null;
16
+ declare const MFPolygon: (props: PolygonProps) => any;
17
17
  export default MFPolygon;
@@ -18,5 +18,5 @@ interface PolylineProps {
18
18
  onMouseOver?: (args: any) => void;
19
19
  onMouseMove?: (args: any) => void;
20
20
  }
21
- declare const MFPolyline: (props: PolylineProps) => null;
21
+ declare const MFPolyline: (props: PolylineProps) => any;
22
22
  export default MFPolyline;
@@ -6,5 +6,5 @@ interface TileOverlayProps {
6
6
  map?: map4d.Map;
7
7
  onCreated?: (tileOverlay: map4d.TileOverlay) => void;
8
8
  }
9
- declare const MFTileOverlay: (props: TileOverlayProps) => null;
9
+ declare const MFTileOverlay: (props: TileOverlayProps) => any;
10
10
  export default MFTileOverlay;
package/dist/index.js CHANGED
@@ -764,6 +764,8 @@ var createId = function createId() {
764
764
  };
765
765
 
766
766
  var MFMap = function MFMap(props) {
767
+ var _props$options3;
768
+
767
769
  var callback = React.useRef("callback");
768
770
  var mapDomRef = React.useRef();
769
771
  var mapRef = React.useRef();
@@ -781,19 +783,15 @@ var MFMap = function MFMap(props) {
781
783
 
782
784
  var createCallback = function createCallback() {
783
785
  window[callback.current] = function () {
784
- if (mapDomRef.current) {
785
- var options = props.options;
786
- mapRef.current = new window.map4d.Map(mapDomRef.current, options);
787
-
788
- if (props.onMapReady) {
789
- props.onMapReady(mapRef.current, id);
790
- }
786
+ var options = props.options;
787
+ mapRef.current = new window.map4d.Map(mapDomRef.current, options);
791
788
 
792
- registerEvent();
793
- setMap(mapRef.current);
794
- } else {
795
- console.error("MFMap: map element is NOT found");
789
+ if (props.onMapReady) {
790
+ props.onMapReady(mapRef.current, id);
796
791
  }
792
+
793
+ registerEvent();
794
+ setMap(mapRef.current);
797
795
  };
798
796
  };
799
797
 
@@ -836,138 +834,143 @@ var MFMap = function MFMap(props) {
836
834
 
837
835
  destroy();
838
836
  };
839
- }, [props.environment, props.version, props.accessKey]);
837
+ }, [props.environment, props.version, props.accessKey, props.options]);
838
+ React.useEffect(function () {
839
+ var _props$options, _mapRef$current2, _props$options2;
840
+
841
+ ((_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));
842
+ }, [(_props$options3 = props.options) === null || _props$options3 === void 0 ? void 0 : _props$options3.mapType]);
840
843
 
841
844
  var registerEvent = function registerEvent() {
842
- var _mapRef$current2, _mapRef$current3, _mapRef$current4, _mapRef$current5, _mapRef$current6, _mapRef$current7, _mapRef$current8, _mapRef$current9, _mapRef$current10, _mapRef$current11, _mapRef$current12, _mapRef$current13, _mapRef$current14, _mapRef$current15, _mapRef$current16, _mapRef$current17, _mapRef$current18, _mapRef$current19, _mapRef$current20;
845
+ var _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;
843
846
 
844
- var eventClickMarker = (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.addListener("click", function (args) {
847
+ var eventClickMarker = (_mapRef$current3 = mapRef.current) === null || _mapRef$current3 === void 0 ? void 0 : _mapRef$current3.addListener("click", function (args) {
845
848
  var _args$marker, _args$marker2;
846
849
 
847
850
  ((_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));
848
851
  }, {
849
852
  marker: true
850
853
  });
851
- var eventRightClickMarker = (_mapRef$current3 = mapRef.current) === null || _mapRef$current3 === void 0 ? void 0 : _mapRef$current3.addListener("rightClick", function (args) {
854
+ var eventRightClickMarker = (_mapRef$current4 = mapRef.current) === null || _mapRef$current4 === void 0 ? void 0 : _mapRef$current4.addListener("rightClick", function (args) {
852
855
  var _args$marker3, _args$marker4;
853
856
 
854
857
  ((_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));
855
858
  }, {
856
859
  marker: true
857
860
  });
858
- var eventDragEndMarker = (_mapRef$current4 = mapRef.current) === null || _mapRef$current4 === void 0 ? void 0 : _mapRef$current4.addListener("dragEnd", function (args) {
861
+ var eventDragEndMarker = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("dragEnd", function (args) {
859
862
  var _args$marker5, _args$marker6;
860
863
 
861
864
  ((_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));
862
865
  }, {
863
866
  marker: true
864
867
  });
865
- var eventHoverMarker = (_mapRef$current5 = mapRef.current) === null || _mapRef$current5 === void 0 ? void 0 : _mapRef$current5.addListener("hover", function (args) {
868
+ var eventHoverMarker = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("hover", function (args) {
866
869
  var _args$marker7, _args$marker8;
867
870
 
868
871
  ((_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));
869
872
  }, {
870
873
  marker: true
871
874
  });
872
- var eventHoverPolygon = (_mapRef$current6 = mapRef.current) === null || _mapRef$current6 === void 0 ? void 0 : _mapRef$current6.addListener("hover", function (args) {
875
+ var eventHoverPolygon = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("hover", function (args) {
873
876
  var _args$polygon, _args$polygon2;
874
877
 
875
878
  ((_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));
876
879
  }, {
877
880
  polygon: true
878
881
  });
879
- var eventHoverPolyline = (_mapRef$current7 = mapRef.current) === null || _mapRef$current7 === void 0 ? void 0 : _mapRef$current7.addListener("hover", function (args) {
882
+ var eventHoverPolyline = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("hover", function (args) {
880
883
  var _args$polyline, _args$polyline2;
881
884
 
882
885
  ((_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));
883
886
  }, {
884
887
  polyline: true
885
888
  });
886
- var eventHoverDirection = (_mapRef$current8 = mapRef.current) === null || _mapRef$current8 === void 0 ? void 0 : _mapRef$current8.addListener("hover", function (args) {
889
+ var eventHoverDirection = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("hover", function (args) {
887
890
  var _args$renderer, _args$renderer2;
888
891
 
889
892
  ((_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));
890
893
  }, {
891
894
  directions: true
892
895
  });
893
- var eventClickPolyline = (_mapRef$current9 = mapRef.current) === null || _mapRef$current9 === void 0 ? void 0 : _mapRef$current9.addListener("click", function (args) {
896
+ var eventClickPolyline = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("click", function (args) {
894
897
  var _args$polyline3, _args$polyline4;
895
898
 
896
899
  ((_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));
897
900
  }, {
898
901
  polyline: true
899
902
  });
900
- var eventMouseOutDirection = (_mapRef$current10 = mapRef.current) === null || _mapRef$current10 === void 0 ? void 0 : _mapRef$current10.addListener("mouseOut", function (args) {
903
+ var eventMouseOutDirection = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("mouseOut", function (args) {
901
904
  var _args$renderer3, _args$renderer4;
902
905
 
903
906
  ((_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));
904
907
  }, {
905
908
  directions: true
906
909
  });
907
- var eventMouseOverDirection = (_mapRef$current11 = mapRef.current) === null || _mapRef$current11 === void 0 ? void 0 : _mapRef$current11.addListener("mouseOver", function (args) {
910
+ var eventMouseOverDirection = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("mouseOver", function (args) {
908
911
  var _args$renderer5, _args$renderer6;
909
912
 
910
913
  ((_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));
911
914
  }, {
912
915
  directions: true
913
916
  });
914
- var eventMouseMoveDirection = (_mapRef$current12 = mapRef.current) === null || _mapRef$current12 === void 0 ? void 0 : _mapRef$current12.addListener("mouseMove", function (args) {
917
+ var eventMouseMoveDirection = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("mouseMove", function (args) {
915
918
  var _args$renderer7, _args$renderer8;
916
919
 
917
920
  ((_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));
918
921
  }, {
919
922
  directions: true
920
923
  });
921
- var eventMouseOutPolyline = (_mapRef$current13 = mapRef.current) === null || _mapRef$current13 === void 0 ? void 0 : _mapRef$current13.addListener("mouseOut", function (args) {
924
+ var eventMouseOutPolyline = (_mapRef$current14 = mapRef.current) === null || _mapRef$current14 === void 0 ? void 0 : _mapRef$current14.addListener("mouseOut", function (args) {
922
925
  var _args$polyline5, _args$polyline6;
923
926
 
924
927
  ((_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));
925
928
  }, {
926
929
  polyline: true
927
930
  });
928
- var eventMouseOverPolyline = (_mapRef$current14 = mapRef.current) === null || _mapRef$current14 === void 0 ? void 0 : _mapRef$current14.addListener("mouseOver", function (args) {
931
+ var eventMouseOverPolyline = (_mapRef$current15 = mapRef.current) === null || _mapRef$current15 === void 0 ? void 0 : _mapRef$current15.addListener("mouseOver", function (args) {
929
932
  var _args$polyline7, _args$polyline8;
930
933
 
931
934
  ((_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));
932
935
  }, {
933
936
  polyline: true
934
937
  });
935
- var eventMouseMovePolyline = (_mapRef$current15 = mapRef.current) === null || _mapRef$current15 === void 0 ? void 0 : _mapRef$current15.addListener("mouseMove", function (args) {
938
+ var eventMouseMovePolyline = (_mapRef$current16 = mapRef.current) === null || _mapRef$current16 === void 0 ? void 0 : _mapRef$current16.addListener("mouseMove", function (args) {
936
939
  var _args$polyline9, _args$polyline10;
937
940
 
938
941
  ((_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));
939
942
  }, {
940
943
  polyline: true
941
944
  });
942
- var eventMouseOutMarker = (_mapRef$current16 = mapRef.current) === null || _mapRef$current16 === void 0 ? void 0 : _mapRef$current16.addListener("mouseOut", function (args) {
945
+ var eventMouseOutMarker = (_mapRef$current17 = mapRef.current) === null || _mapRef$current17 === void 0 ? void 0 : _mapRef$current17.addListener("mouseOut", function (args) {
943
946
  var _args$marker9, _args$marker10;
944
947
 
945
948
  ((_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));
946
949
  }, {
947
950
  marker: true
948
951
  });
949
- var eventMouseOverMarker = (_mapRef$current17 = mapRef.current) === null || _mapRef$current17 === void 0 ? void 0 : _mapRef$current17.addListener("mouseOver", function (args) {
952
+ var eventMouseOverMarker = (_mapRef$current18 = mapRef.current) === null || _mapRef$current18 === void 0 ? void 0 : _mapRef$current18.addListener("mouseOver", function (args) {
950
953
  var _args$marker11, _args$marker12;
951
954
 
952
955
  ((_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));
953
956
  }, {
954
957
  marker: true
955
958
  });
956
- var eventMouseMoveMarker = (_mapRef$current18 = mapRef.current) === null || _mapRef$current18 === void 0 ? void 0 : _mapRef$current18.addListener("mouseMove", function (args) {
959
+ var eventMouseMoveMarker = (_mapRef$current19 = mapRef.current) === null || _mapRef$current19 === void 0 ? void 0 : _mapRef$current19.addListener("mouseMove", function (args) {
957
960
  var _args$marker13, _args$marker14;
958
961
 
959
962
  ((_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));
960
963
  }, {
961
964
  marker: true
962
965
  });
963
- var eventClickPoi = (_mapRef$current19 = mapRef.current) === null || _mapRef$current19 === void 0 ? void 0 : _mapRef$current19.addListener("click", function (args) {
966
+ var eventClickPoi = (_mapRef$current20 = mapRef.current) === null || _mapRef$current20 === void 0 ? void 0 : _mapRef$current20.addListener("click", function (args) {
964
967
  var _args$poi, _args$poi2;
965
968
 
966
969
  ((_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));
967
970
  }, {
968
971
  poi: true
969
972
  });
970
- var eventHoverPoi = (_mapRef$current20 = mapRef.current) === null || _mapRef$current20 === void 0 ? void 0 : _mapRef$current20.addListener("hover", function (args) {
973
+ var eventHoverPoi = (_mapRef$current21 = mapRef.current) === null || _mapRef$current21 === void 0 ? void 0 : _mapRef$current21.addListener("hover", function (args) {
971
974
  var _args$poi3, _args$poi4;
972
975
 
973
976
  ((_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));
@@ -977,9 +980,9 @@ var MFMap = function MFMap(props) {
977
980
  events.current = events.current.concat([eventClickMarker, eventRightClickMarker, eventDragEndMarker, eventHoverMarker, eventHoverPolygon, eventHoverPolyline, eventHoverDirection, eventClickPolyline, eventMouseOutDirection, eventMouseOverDirection, eventMouseMoveDirection, eventMouseOutPolyline, eventMouseOverPolyline, eventMouseMovePolyline, eventMouseOutMarker, eventMouseOverMarker, eventMouseMoveMarker, eventClickPoi, eventHoverPoi]);
978
981
 
979
982
  if (props.onClickLocation) {
980
- var _mapRef$current21;
983
+ var _mapRef$current22;
981
984
 
982
- var onClickLocation = (_mapRef$current21 = mapRef.current) === null || _mapRef$current21 === void 0 ? void 0 : _mapRef$current21.addListener("click", function (args) {
985
+ var onClickLocation = (_mapRef$current22 = mapRef.current) === null || _mapRef$current22 === void 0 ? void 0 : _mapRef$current22.addListener("click", function (args) {
983
986
  props.onClickLocation && props.onClickLocation(args);
984
987
  }, {
985
988
  location: true
@@ -988,9 +991,9 @@ var MFMap = function MFMap(props) {
988
991
  }
989
992
 
990
993
  if (props.onRightClickLocation) {
991
- var _mapRef$current22;
994
+ var _mapRef$current23;
992
995
 
993
- var onRightClickLocation = (_mapRef$current22 = mapRef.current) === null || _mapRef$current22 === void 0 ? void 0 : _mapRef$current22.addListener("rightClick", function (args) {
996
+ var onRightClickLocation = (_mapRef$current23 = mapRef.current) === null || _mapRef$current23 === void 0 ? void 0 : _mapRef$current23.addListener("rightClick", function (args) {
994
997
  props.onRightClickLocation && props.onRightClickLocation(args);
995
998
  }, {
996
999
  location: true
@@ -999,9 +1002,9 @@ var MFMap = function MFMap(props) {
999
1002
  }
1000
1003
 
1001
1004
  if (props.onTilesLoaded) {
1002
- var _mapRef$current23;
1005
+ var _mapRef$current24;
1003
1006
 
1004
- var onTilesLoaded = (_mapRef$current23 = mapRef.current) === null || _mapRef$current23 === void 0 ? void 0 : _mapRef$current23.addListener("tilesLoaded", function (args) {
1007
+ var onTilesLoaded = (_mapRef$current24 = mapRef.current) === null || _mapRef$current24 === void 0 ? void 0 : _mapRef$current24.addListener("tilesLoaded", function (args) {
1005
1008
  props.onTilesLoaded && props.onTilesLoaded(args);
1006
1009
  }, {
1007
1010
  location: true
@@ -1010,9 +1013,9 @@ var MFMap = function MFMap(props) {
1010
1013
  }
1011
1014
 
1012
1015
  if (props.onCameraChanging) {
1013
- var _mapRef$current24;
1016
+ var _mapRef$current25;
1014
1017
 
1015
- var onCameraChanging = (_mapRef$current24 = mapRef.current) === null || _mapRef$current24 === void 0 ? void 0 : _mapRef$current24.addListener("cameraChanging", function (args) {
1018
+ var onCameraChanging = (_mapRef$current25 = mapRef.current) === null || _mapRef$current25 === void 0 ? void 0 : _mapRef$current25.addListener("cameraChanging", function (args) {
1016
1019
  props.onCameraChanging && props.onCameraChanging(args);
1017
1020
  }, {
1018
1021
  location: true
@@ -1024,21 +1027,16 @@ var MFMap = function MFMap(props) {
1024
1027
  var newContext = {
1025
1028
  map: map
1026
1029
  };
1027
-
1028
- var refDiv = function refDiv(r) {
1029
- mapDomRef.current = r;
1030
- };
1031
-
1032
- return React__default.createElement(Map4dContext.Provider, {
1033
- value: newContext
1034
- }, React__default.createElement("div", {
1030
+ return React__default.createElement(React.Fragment, null, React__default.createElement("div", {
1035
1031
  style: {
1036
1032
  width: '100%',
1037
1033
  height: '100%',
1038
1034
  display: 'block'
1039
1035
  },
1040
- ref: refDiv
1041
- }), props.children);
1036
+ ref: mapDomRef
1037
+ }), React__default.createElement(Map4dContext.Provider, {
1038
+ value: newContext
1039
+ }, props.children));
1042
1040
  };
1043
1041
 
1044
1042
  var MFMarker = function MFMarker(props) {