react-map4d-map 1.2.6 → 1.2.7

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.
@@ -1,4 +1,4 @@
1
- import React, { createContext, useContext, useRef, useEffect, useState } from 'react';
1
+ import React, { createContext, useContext, useRef, useEffect, useState, Fragment } from 'react';
2
2
 
3
3
  var defaultCt = {
4
4
  map: null
@@ -778,19 +778,15 @@ var MFMap = function MFMap(props) {
778
778
 
779
779
  var createCallback = function createCallback() {
780
780
  window[callback.current] = function () {
781
- if (mapDomRef.current) {
782
- var options = props.options;
783
- mapRef.current = new window.map4d.Map(mapDomRef.current, options);
781
+ var options = props.options;
782
+ mapRef.current = new window.map4d.Map(mapDomRef.current, options);
784
783
 
785
- if (props.onMapReady) {
786
- props.onMapReady(mapRef.current, id);
787
- }
788
-
789
- registerEvent();
790
- setMap(mapRef.current);
791
- } else {
792
- console.error("MFMap: map element is NOT found");
784
+ if (props.onMapReady) {
785
+ props.onMapReady(mapRef.current, id);
793
786
  }
787
+
788
+ registerEvent();
789
+ setMap(mapRef.current);
794
790
  };
795
791
  };
796
792
 
@@ -833,7 +829,7 @@ var MFMap = function MFMap(props) {
833
829
 
834
830
  destroy();
835
831
  };
836
- }, [props.environment, props.version, props.accessKey]);
832
+ }, [props.environment, props.version, props.accessKey, props.options]);
837
833
 
838
834
  var registerEvent = function registerEvent() {
839
835
  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;
@@ -1021,21 +1017,16 @@ var MFMap = function MFMap(props) {
1021
1017
  var newContext = {
1022
1018
  map: map
1023
1019
  };
1024
-
1025
- var refDiv = function refDiv(r) {
1026
- mapDomRef.current = r;
1027
- };
1028
-
1029
- return React.createElement(Map4dContext.Provider, {
1030
- value: newContext
1031
- }, React.createElement("div", {
1020
+ return React.createElement(Fragment, null, React.createElement("div", {
1032
1021
  style: {
1033
1022
  width: '100%',
1034
1023
  height: '100%',
1035
1024
  display: 'block'
1036
1025
  },
1037
- ref: refDiv
1038
- }), props.children);
1026
+ ref: mapDomRef
1027
+ }), React.createElement(Map4dContext.Provider, {
1028
+ value: newContext
1029
+ }, props.children));
1039
1030
  };
1040
1031
 
1041
1032
  var MFMarker = function MFMarker(props) {