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.
- package/dist/index.js +13 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +14 -23
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -781,19 +781,15 @@ var MFMap = function MFMap(props) {
|
|
|
781
781
|
|
|
782
782
|
var createCallback = function createCallback() {
|
|
783
783
|
window[callback.current] = function () {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
mapRef.current = new window.map4d.Map(mapDomRef.current, options);
|
|
784
|
+
var options = props.options;
|
|
785
|
+
mapRef.current = new window.map4d.Map(mapDomRef.current, options);
|
|
787
786
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
registerEvent();
|
|
793
|
-
setMap(mapRef.current);
|
|
794
|
-
} else {
|
|
795
|
-
console.error("MFMap: map element is NOT found");
|
|
787
|
+
if (props.onMapReady) {
|
|
788
|
+
props.onMapReady(mapRef.current, id);
|
|
796
789
|
}
|
|
790
|
+
|
|
791
|
+
registerEvent();
|
|
792
|
+
setMap(mapRef.current);
|
|
797
793
|
};
|
|
798
794
|
};
|
|
799
795
|
|
|
@@ -836,7 +832,7 @@ var MFMap = function MFMap(props) {
|
|
|
836
832
|
|
|
837
833
|
destroy();
|
|
838
834
|
};
|
|
839
|
-
}, [props.environment, props.version, props.accessKey]);
|
|
835
|
+
}, [props.environment, props.version, props.accessKey, props.options]);
|
|
840
836
|
|
|
841
837
|
var registerEvent = function registerEvent() {
|
|
842
838
|
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;
|
|
@@ -1024,21 +1020,16 @@ var MFMap = function MFMap(props) {
|
|
|
1024
1020
|
var newContext = {
|
|
1025
1021
|
map: map
|
|
1026
1022
|
};
|
|
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", {
|
|
1023
|
+
return React__default.createElement(React.Fragment, null, React__default.createElement("div", {
|
|
1035
1024
|
style: {
|
|
1036
1025
|
width: '100%',
|
|
1037
1026
|
height: '100%',
|
|
1038
1027
|
display: 'block'
|
|
1039
1028
|
},
|
|
1040
|
-
ref:
|
|
1041
|
-
}),
|
|
1029
|
+
ref: mapDomRef
|
|
1030
|
+
}), React__default.createElement(Map4dContext.Provider, {
|
|
1031
|
+
value: newContext
|
|
1032
|
+
}, props.children));
|
|
1042
1033
|
};
|
|
1043
1034
|
|
|
1044
1035
|
var MFMarker = function MFMarker(props) {
|