react-native-map4d-map-dtqg 0.1.2 → 0.1.4
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/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/ios/Map4dMap.xcodeproj/project.pbxproj +2 -2
- package/ios/RMFMapViewManager.m +2 -1
- package/lib/commonjs/components/MFBuilding.js +24 -6
- package/lib/commonjs/components/MFBuilding.js.map +1 -1
- package/lib/commonjs/components/MFCircle.js +24 -6
- package/lib/commonjs/components/MFCircle.js.map +1 -1
- package/lib/commonjs/components/MFDirectionsRenderer.js +24 -6
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/commonjs/components/MFMapView.js +22 -5
- package/lib/commonjs/components/MFMapView.js.map +1 -1
- package/lib/commonjs/components/MFMarker.js +24 -6
- package/lib/commonjs/components/MFMarker.js.map +1 -1
- package/lib/commonjs/components/MFPOI.js +24 -6
- package/lib/commonjs/components/MFPOI.js.map +1 -1
- package/lib/commonjs/components/MFPolygon.js +24 -6
- package/lib/commonjs/components/MFPolygon.js.map +1 -1
- package/lib/commonjs/components/MFPolyline.js +24 -6
- package/lib/commonjs/components/MFPolyline.js.map +1 -1
- package/lib/module/components/MFBuilding.js +25 -7
- package/lib/module/components/MFBuilding.js.map +1 -1
- package/lib/module/components/MFCircle.js +25 -7
- package/lib/module/components/MFCircle.js.map +1 -1
- package/lib/module/components/MFDirectionsRenderer.js +25 -7
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/module/components/MFMapView.js +23 -6
- package/lib/module/components/MFMapView.js.map +1 -1
- package/lib/module/components/MFMarker.js +25 -7
- package/lib/module/components/MFMarker.js.map +1 -1
- package/lib/module/components/MFPOI.js +25 -7
- package/lib/module/components/MFPOI.js.map +1 -1
- package/lib/module/components/MFPolygon.js +25 -7
- package/lib/module/components/MFPolygon.js.map +1 -1
- package/lib/module/components/MFPolyline.js +25 -7
- package/lib/module/components/MFPolyline.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MFBuilding.js +23 -10
- package/src/components/MFCircle.js +23 -10
- package/src/components/MFDirectionsRenderer.js +23 -10
- package/src/components/MFMapView.js +23 -7
- package/src/components/MFMarker.js +23 -10
- package/src/components/MFPOI.js +23 -10
- package/src/components/MFPolygon.js +23 -10
- package/src/components/MFPolyline.js +23 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","holes","fillColor","strokeColor","strokeWidth","zIndex","visible","bool","userData","object","onPress","func","MFPolygon","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polygon","setCoordinates","_runCommand","setHoles","setFillColor","color","setStrokeColor","setStrokeWidth","width","setVisible","setZIndex","setUserData","_getHandle","name","args","OS","
|
|
1
|
+
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","UIManager","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","holes","fillColor","strokeColor","strokeWidth","zIndex","visible","bool","userData","object","onPress","func","MFPolygon","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polygon","setCoordinates","_runCommand","setHoles","setFillColor","color","setStrokeColor","setStrokeWidth","width","setVisible","setZIndex","setUserData","_getHandle","name","args","OS","dispatchViewManagerCommand","commandId","_uiManagerCommand","_mapManagerCommand","uiManager","componentName","getViewManagerConfig","legacyConfig","Commands","config","render","RMFPolygon"],"sources":["MFPolygon.js"],"sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';\r\nimport {\r\n requireNativeComponent,\r\n Platform,\r\n UIManager,\r\n NativeModules,\r\n findNodeHandle,\r\n processColor\r\n} from 'react-native';\r\n\r\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\r\nconst viewPropTypes = ViewPropTypes || View.propTypes;\r\n\r\nconst propTypes = {\r\n ...viewPropTypes,\r\n\r\n /**\r\n * An array of coordinates to describe the polygon\r\n */\r\n coordinates: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n /**\r\n * Latitude/Longitude coordinates\r\n */\r\n latitude: PropTypes.number.isRequired,\r\n longitude: PropTypes.number.isRequired,\r\n })\r\n ),\r\n\r\n /**\r\n * An array of array of coordinates to describe the polygon holes\r\n */\r\n holes: PropTypes.arrayOf(\r\n PropTypes.arrayOf(\r\n PropTypes.shape({\r\n /**\r\n * Latitude/Longitude coordinates\r\n */\r\n latitude: PropTypes.number.isRequired,\r\n longitude: PropTypes.number.isRequired,\r\n })\r\n )\r\n ),\r\n\r\n /**\r\n * The color to use for the polygon.\r\n */\r\n fillColor: ColorPropType,\r\n\r\n /**\r\n * The color to use for the polygon stroke.\r\n */\r\n strokeColor: ColorPropType,\r\n\r\n /**\r\n * The stroke width to use for the polygon.\r\n */\r\n strokeWidth: PropTypes.number,\r\n\r\n /**\r\n * zIndex\r\n */\r\n zIndex: PropTypes.number,\r\n\r\n /**\r\n * visible\r\n */\r\n visible: PropTypes.bool,\r\n\r\n /**\r\n * userData\r\n */\r\n userData:PropTypes.object,\r\n\r\n /**\r\n * Callback that is called when the user presses on the polygon\r\n */\r\n onPress: PropTypes.func,\r\n};\r\n\r\n\r\nclass MFPolygon extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this._onPress = this._onPress.bind(this)\r\n this._ref = this._ref.bind(this)\r\n }\r\n\r\n _onPress(event) {\r\n event.stopPropagation();\r\n if (this.props.onPress) {\r\n this.props.onPress(event);\r\n }\r\n }\r\n\r\n _ref(ref) {\r\n this.polygon = ref;\r\n }\r\n\r\n setCoordinates(coordinates) {\r\n this._runCommand(\"setCoordinates\", [coordinates])\r\n }\r\n\r\n setHoles(holes) {\r\n this._runCommand(\"setHoles\", [holes])\r\n }\r\n\r\n setFillColor(color) {\r\n this._runCommand(\"setFillColor\", [processColor(color)])\r\n }\r\n\r\n setStrokeColor(color) {\r\n this._runCommand(\"setStrokeColor\", [processColor(color)])\r\n }\r\n\r\n setStrokeWidth(width) {\r\n this._runCommand(\"setStrokeWidth\", [width])\r\n }\r\n\r\n setVisible(visible) {\r\n this._runCommand(\"setVisible\", [visible])\r\n }\r\n\r\n setZIndex(zIndex) {\r\n this._runCommand(\"setZIndex\", [zIndex])\r\n }\r\n\r\n setUserData(userData) {\r\n this._runCommand(\"setUserData\", [userData])\r\n }\r\n\r\n _getHandle() {\r\n return findNodeHandle(this.polygon);\r\n }\r\n\r\n _runCommand(name, args) {\r\n switch (Platform.OS) {\r\n case 'android': {\r\n if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {\r\n return;\r\n }\r\n\r\n const commandId = this._uiManagerCommand(name);\r\n if (commandId == null) {\r\n return;\r\n }\r\n\r\n UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);\r\n break;\r\n }\r\n\r\n case 'ios':\r\n this._mapManagerCommand(name)(this._getHandle(), ...args);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n _uiManagerCommand(name) {\r\n const uiManager = UIManager || NativeModules.UIManager;\r\n const componentName = \"RMFPolygon\";\r\n\r\n if (!uiManager) {\r\n return null;\r\n }\r\n\r\n if (!uiManager.getViewManagerConfig) {\r\n // RN < 0.58\r\n const legacyConfig = uiManager[componentName];\r\n return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;\r\n }\r\n\r\n // RN >= 0.58 \r\n const config = uiManager.getViewManagerConfig(componentName);\r\n return config && config.Commands ? config.Commands[name] : null;\r\n }\r\n\r\n _mapManagerCommand(name) {\r\n return NativeModules[`RMFPolygon`][name];\r\n }\r\n\r\n render() {\r\n return <RMFPolygon\r\n {...this.props}\r\n ref={this._ref}\r\n onPress={this._onPress}\r\n />;\r\n }\r\n}\r\n\r\nMFPolygon.propTypes = propTypes;\r\n\r\nvar RMFPolygon = requireNativeComponent(`RMFPolygon`, MFPolygon);\r\n\r\nexport { MFPolygon }\r\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,aAAR,EAAuBC,aAAvB,QAA2C,oCAA3C;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,aAJF,EAKEC,cALF,EAMEC,YANF,QAOO,cAPP,C,CASA;;AACA,MAAMC,aAAa,GAAGR,aAAa,IAAIS,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;AACF;AACA;EACEG,WAAW,EAAEZ,SAAS,CAACa,OAAV,CACXb,SAAS,CAACc,KAAV,CAAgB;IACd;AACN;AACA;IACMC,QAAQ,EAAEf,SAAS,CAACgB,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAElB,SAAS,CAACgB,MAAV,CAAiBC;EALd,CAAhB,CADW,CANG;;EAgBhB;AACF;AACA;EACEE,KAAK,EAAEnB,SAAS,CAACa,OAAV,CACLb,SAAS,CAACa,OAAV,CACEb,SAAS,CAACc,KAAV,CAAgB;IACd;AACR;AACA;IACQC,QAAQ,EAAEf,SAAS,CAACgB,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAElB,SAAS,CAACgB,MAAV,CAAiBC;EALd,CAAhB,CADF,CADK,CAnBS;;EA+BhB;AACF;AACA;EACEG,SAAS,EAAElB,aAlCK;;EAoChB;AACF;AACA;EACEmB,W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;IACD;;IAED,IAAI,CAACA,SAAS,CAACE,oBAAf,EAAqC;MACnC;MACA,MAAMC,YAAY,GAAGH,SAAS,CAACC,aAAD,CAA9B;MACA,OAAOE,YAAY,IAAIA,YAAY,CAACC,QAA7B,GAAwCD,YAAY,CAACC,QAAb,CAAsBX,IAAtB,CAAxC,GAAsE,IAA7E;IACD,CAZqB,CActB;;;IACA,MAAMY,MAAM,GAAGL,SAAS,CAACE,oBAAV,CAA+BD,aAA/B,CAAf;IACA,OAAOI,MAAM,IAAIA,MAAM,CAACD,QAAjB,GAA4BC,MAAM,CAACD,QAAP,CAAgBX,IAAhB,CAA5B,GAAoD,IAA3D;EACD;;EAEDM,kBAAkB,CAACN,IAAD,EAAO;IACvB,OAAO/C,aAAa,CAAE,YAAF,CAAb,CAA4B+C,IAA5B,CAAP;EACD;;EAEDa,MAAM,GAAG;IACP,oBAAO,oBAAC,UAAD,eACD,KAAKjC,KADJ;MAEL,GAAG,EAAE,KAAKG,IAFL;MAGL,OAAO,EAAE,KAAKF;IAHT,GAAP;EAKD;;AA5GqC;;AA+GxCJ,SAAS,CAACnB,SAAV,GAAsBA,SAAtB;AAEA,IAAIwD,UAAU,GAAGhE,sBAAsB,CAAE,YAAF,EAAe2B,SAAf,CAAvC;AAEA,SAASA,SAAT"}
|
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { ViewPropTypes, ColorPropType } from 'deprecated-react-native-prop-types';
|
|
6
|
-
import { requireNativeComponent, Platform, NativeModules, findNodeHandle, processColor } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
6
|
+
import { requireNativeComponent, Platform, UIManager, NativeModules, findNodeHandle, processColor } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
7
7
|
|
|
8
8
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
9
9
|
const propTypes = { ...viewPropTypes,
|
|
@@ -114,8 +114,20 @@ class MFPolyline extends React.Component {
|
|
|
114
114
|
_runCommand(name, args) {
|
|
115
115
|
switch (Platform.OS) {
|
|
116
116
|
case 'android':
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
{
|
|
118
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const commandId = this._uiManagerCommand(name);
|
|
123
|
+
|
|
124
|
+
if (commandId == null) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
119
131
|
|
|
120
132
|
case 'ios':
|
|
121
133
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -128,16 +140,22 @@ class MFPolyline extends React.Component {
|
|
|
128
140
|
}
|
|
129
141
|
|
|
130
142
|
_uiManagerCommand(name) {
|
|
131
|
-
const
|
|
143
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
132
144
|
const componentName = "RMFPolyline";
|
|
133
145
|
|
|
134
|
-
if (!
|
|
146
|
+
if (!uiManager) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (!uiManager.getViewManagerConfig) {
|
|
135
151
|
// RN < 0.58
|
|
136
|
-
|
|
152
|
+
const legacyConfig = uiManager[componentName];
|
|
153
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
137
154
|
} // RN >= 0.58
|
|
138
155
|
|
|
139
156
|
|
|
140
|
-
|
|
157
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
158
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
141
159
|
}
|
|
142
160
|
|
|
143
161
|
_mapManagerCommand(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","color","width","lineStyle","oneOf","zIndex","visible","bool","userData","object","onPress","func","MFPolyline","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polyline","setCoordinates","_runCommand","setWidth","setColor","setVisible","setTouchable","touchable","setZIndex","setLineStyle","style","setUserData","_getHandle","name","args","OS","
|
|
1
|
+
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","UIManager","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","color","width","lineStyle","oneOf","zIndex","visible","bool","userData","object","onPress","func","MFPolyline","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polyline","setCoordinates","_runCommand","setWidth","setColor","setVisible","setTouchable","touchable","setZIndex","setLineStyle","style","setUserData","_getHandle","name","args","OS","dispatchViewManagerCommand","commandId","_uiManagerCommand","_mapManagerCommand","uiManager","componentName","getViewManagerConfig","legacyConfig","Commands","config","render","RMFPolyline"],"sources":["MFPolyline.js"],"sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';\r\nimport {\r\n requireNativeComponent,\r\n Platform,\r\n UIManager,\r\n NativeModules,\r\n findNodeHandle,\r\n processColor\r\n} from 'react-native';\r\n\r\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\r\nconst viewPropTypes = ViewPropTypes || View.propTypes;\r\n\r\nconst propTypes = {\r\n ...viewPropTypes,\r\n\r\n /**\r\n * An array of coordinates to describe the polyline\r\n */\r\n coordinates: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n /**\r\n * Latitude/Longitude coordinates\r\n */\r\n latitude: PropTypes.number.isRequired,\r\n longitude: PropTypes.number.isRequired,\r\n })\r\n ),\r\n\r\n /**\r\n * The color to use for the path.\r\n */\r\n color: ColorPropType,\r\n\r\n /**\r\n * The stroke width to use for the path.\r\n */\r\n width: PropTypes.number,\r\n\r\n /**\r\n * The default style is `solid`.\r\n */\r\n lineStyle: PropTypes.oneOf(['solid', 'dotted']),\r\n\r\n /**\r\n * zIndex\r\n */\r\n zIndex: PropTypes.number,\r\n\r\n /**\r\n * visible\r\n */\r\n visible: PropTypes.bool,\r\n\r\n /**\r\n * userData\r\n */\r\n userData:PropTypes.object,\r\n\r\n /**\r\n * Callback that is called when the user presses on the polyline\r\n */\r\n onPress: PropTypes.func,\r\n};\r\n\r\n\r\nclass MFPolyline extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this._onPress = this._onPress.bind(this)\r\n this._ref = this._ref.bind(this)\r\n }\r\n\r\n _onPress(event) {\r\n event.stopPropagation();\r\n if (this.props.onPress) {\r\n this.props.onPress(event);\r\n }\r\n }\r\n\r\n _ref(ref) {\r\n this.polyline = ref;\r\n }\r\n\r\n // TODO - bug\r\n setCoordinates(coordinates) {\r\n this._runCommand(\"setCoordinates\", [coordinates])\r\n }\r\n\r\n setWidth(width) {\r\n this._runCommand(\"setWidth\", [width])\r\n }\r\n\r\n setColor(color) {\r\n this._runCommand(\"setColor\", [processColor(color)])\r\n }\r\n\r\n setVisible(visible) {\r\n this._runCommand(\"setVisible\", [visible])\r\n }\r\n\r\n setTouchable(touchable) {\r\n this._runCommand(\"setTouchable\", [touchable])\r\n }\r\n\r\n setZIndex(zIndex) {\r\n this._runCommand(\"setZIndex\", [zIndex])\r\n }\r\n\r\n setLineStyle(style) {\r\n this._runCommand(\"setLineStyle\", [style])\r\n }\r\n\r\n setUserData(userData) {\r\n this._runCommand(\"setUserData\", [userData])\r\n }\r\n\r\n _getHandle() {\r\n return findNodeHandle(this.polyline);\r\n }\r\n\r\n _runCommand(name, args) {\r\n switch (Platform.OS) {\r\n case 'android': {\r\n if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {\r\n return;\r\n }\r\n\r\n const commandId = this._uiManagerCommand(name);\r\n if (commandId == null) {\r\n return;\r\n }\r\n\r\n UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);\r\n break;\r\n }\r\n\r\n case 'ios':\r\n this._mapManagerCommand(name)(this._getHandle(), ...args);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n _uiManagerCommand(name) {\r\n const uiManager = UIManager || NativeModules.UIManager;\r\n const componentName = \"RMFPolyline\";\r\n\r\n if (!uiManager) {\r\n return null;\r\n }\r\n\r\n if (!uiManager.getViewManagerConfig) {\r\n // RN < 0.58\r\n const legacyConfig = uiManager[componentName];\r\n return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;\r\n }\r\n\r\n // RN >= 0.58 \r\n const config = uiManager.getViewManagerConfig(componentName);\r\n return config && config.Commands ? config.Commands[name] : null;\r\n }\r\n\r\n _mapManagerCommand(name) {\r\n return NativeModules[`RMFPolyline`][name];\r\n }\r\n\r\n render() {\r\n return <RMFPolyline\r\n {...this.props}\r\n ref={this._ref}\r\n onPress={this._onPress}\r\n />;\r\n }\r\n}\r\n\r\nMFPolyline.propTypes = propTypes;\r\n\r\nvar RMFPolyline = requireNativeComponent(`RMFPolyline`, MFPolyline);\r\n\r\nexport { MFPolyline }\r\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,aAAR,EAAuBC,aAAvB,QAA2C,oCAA3C;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,aAJF,EAKEC,cALF,EAMEC,YANF,QAOO,cAPP,C,CASA;;AACA,MAAMC,aAAa,GAAGR,aAAa,IAAIS,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;AACF;AACA;EACEG,WAAW,EAAEZ,SAAS,CAACa,OAAV,CACXb,SAAS,CAACc,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BAAL,CAAwBN,IAAxB,EAA8B,KAAKD,UAAL,EAA9B,EAAiD,GAAGE,IAApD;;QACA;;MAEF;QACE;IApBJ;EAsBD;;EAEDI,iBAAiB,CAACL,IAAD,EAAO;IACtB,MAAMO,SAAS,GAAGvD,SAAS,IAAIC,aAAa,CAACD,SAA7C;IACA,MAAMwD,aAAa,GAAG,aAAtB;;IAEA,IAAI,CAACD,SAAL,EAAgB;MACd,OAAO,IAAP;IACD;;IAED,IAAI,CAACA,SAAS,CAACE,oBAAf,EAAqC;MACnC;MACA,MAAMC,YAAY,GAAGH,SAAS,CAACC,aAAD,CAA9B;MACA,OAAOE,YAAY,IAAIA,YAAY,CAACC,QAA7B,GAAwCD,YAAY,CAACC,QAAb,CAAsBX,IAAtB,CAAxC,GAAsE,IAA7E;IACD,CAZqB,CActB;;;IACA,MAAMY,MAAM,GAAGL,SAAS,CAACE,oBAAV,CAA+BD,aAA/B,CAAf;IACA,OAAOI,MAAM,IAAIA,MAAM,CAACD,QAAjB,GAA4BC,MAAM,CAACD,QAAP,CAAgBX,IAAhB,CAA5B,GAAoD,IAA3D;EACD;;EAEDM,kBAAkB,CAACN,IAAD,EAAO;IACvB,OAAO/C,aAAa,CAAE,aAAF,CAAb,CAA6B+C,IAA7B,CAAP;EACD;;EAEDa,MAAM,GAAG;IACP,oBAAO,oBAAC,WAAD,eACD,KAAKjC,KADJ;MAEL,GAAG,EAAE,KAAKG,IAFL;MAGL,OAAO,EAAE,KAAKF;IAHT,GAAP;EAKD;;AA7GsC;;AAgHzCJ,UAAU,CAACnB,SAAX,GAAuBA,SAAvB;AAEA,IAAIwD,WAAW,GAAGhE,sBAAsB,CAAE,aAAF,EAAgB2B,UAAhB,CAAxC;AAEA,SAASA,UAAT"}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import {ViewPropTypes} from 'deprecated-react-native-prop-types';
|
|
|
4
4
|
import {
|
|
5
5
|
requireNativeComponent,
|
|
6
6
|
Platform,
|
|
7
|
+
UIManager,
|
|
7
8
|
NativeModules,
|
|
8
9
|
findNodeHandle
|
|
9
10
|
} from 'react-native';
|
|
@@ -138,13 +139,19 @@ class MFBuilding extends React.Component {
|
|
|
138
139
|
|
|
139
140
|
_runCommand(name, args) {
|
|
140
141
|
switch (Platform.OS) {
|
|
141
|
-
case 'android':
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
);
|
|
142
|
+
case 'android': {
|
|
143
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const commandId = this._uiManagerCommand(name);
|
|
148
|
+
if (commandId == null) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
147
153
|
break;
|
|
154
|
+
}
|
|
148
155
|
|
|
149
156
|
case 'ios':
|
|
150
157
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -156,16 +163,22 @@ class MFBuilding extends React.Component {
|
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
_uiManagerCommand(name) {
|
|
159
|
-
const
|
|
166
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
160
167
|
const componentName = "RMFBuilding";
|
|
161
168
|
|
|
162
|
-
if (!
|
|
169
|
+
if (!uiManager) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (!uiManager.getViewManagerConfig) {
|
|
163
174
|
// RN < 0.58
|
|
164
|
-
|
|
175
|
+
const legacyConfig = uiManager[componentName];
|
|
176
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
165
177
|
}
|
|
166
178
|
|
|
167
179
|
// RN >= 0.58
|
|
168
|
-
|
|
180
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
181
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
169
182
|
}
|
|
170
183
|
|
|
171
184
|
_mapManagerCommand(name) {
|
|
@@ -4,6 +4,7 @@ import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
|
4
4
|
import {
|
|
5
5
|
requireNativeComponent,
|
|
6
6
|
Platform,
|
|
7
|
+
UIManager,
|
|
7
8
|
NativeModules,
|
|
8
9
|
findNodeHandle,
|
|
9
10
|
processColor
|
|
@@ -111,13 +112,19 @@ class MFCircle extends React.Component {
|
|
|
111
112
|
|
|
112
113
|
_runCommand(name, args) {
|
|
113
114
|
switch (Platform.OS) {
|
|
114
|
-
case 'android':
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
115
|
+
case 'android': {
|
|
116
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const commandId = this._uiManagerCommand(name);
|
|
121
|
+
if (commandId == null) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
120
126
|
break;
|
|
127
|
+
}
|
|
121
128
|
|
|
122
129
|
case 'ios':
|
|
123
130
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -129,16 +136,22 @@ class MFCircle extends React.Component {
|
|
|
129
136
|
}
|
|
130
137
|
|
|
131
138
|
_uiManagerCommand(name) {
|
|
132
|
-
const
|
|
139
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
133
140
|
const componentName = "RMFCircle";
|
|
134
141
|
|
|
135
|
-
if (!
|
|
142
|
+
if (!uiManager) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!uiManager.getViewManagerConfig) {
|
|
136
147
|
// RN < 0.58
|
|
137
|
-
|
|
148
|
+
const legacyConfig = uiManager[componentName];
|
|
149
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
138
150
|
}
|
|
139
151
|
|
|
140
152
|
// RN >= 0.58
|
|
141
|
-
|
|
153
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
154
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
142
155
|
}
|
|
143
156
|
|
|
144
157
|
_mapManagerCommand(name) {
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
requireNativeComponent,
|
|
6
6
|
Platform,
|
|
7
7
|
Image,
|
|
8
|
+
UIManager,
|
|
8
9
|
NativeModules,
|
|
9
10
|
findNodeHandle,
|
|
10
11
|
processColor
|
|
@@ -191,13 +192,19 @@ class MFDirectionsRenderer extends React.Component {
|
|
|
191
192
|
|
|
192
193
|
_runCommand(name, args) {
|
|
193
194
|
switch (Platform.OS) {
|
|
194
|
-
case 'android':
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
);
|
|
195
|
+
case 'android': {
|
|
196
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const commandId = this._uiManagerCommand(name);
|
|
201
|
+
if (commandId == null) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
200
206
|
break;
|
|
207
|
+
}
|
|
201
208
|
|
|
202
209
|
case 'ios':
|
|
203
210
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -213,16 +220,22 @@ class MFDirectionsRenderer extends React.Component {
|
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
_uiManagerCommand(name) {
|
|
216
|
-
const
|
|
223
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
217
224
|
const componentName = "RMFDirectionsRenderer";
|
|
218
225
|
|
|
219
|
-
if (!
|
|
226
|
+
if (!uiManager) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (!uiManager.getViewManagerConfig) {
|
|
220
231
|
// RN < 0.58
|
|
221
|
-
|
|
232
|
+
const legacyConfig = uiManager[componentName];
|
|
233
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
222
234
|
}
|
|
223
235
|
|
|
224
236
|
// RN >= 0.58
|
|
225
|
-
|
|
237
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
238
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
226
239
|
}
|
|
227
240
|
|
|
228
241
|
_mapManagerCommand(name) {
|
|
@@ -7,6 +7,7 @@ import {MFPolygon} from './MFPolygon';
|
|
|
7
7
|
import {
|
|
8
8
|
requireNativeComponent,
|
|
9
9
|
Platform,
|
|
10
|
+
UIManager,
|
|
10
11
|
NativeModules,
|
|
11
12
|
findNodeHandle
|
|
12
13
|
} from 'react-native';
|
|
@@ -385,12 +386,22 @@ class MFMapView extends React.Component {
|
|
|
385
386
|
|
|
386
387
|
_runCommand(name, args) {
|
|
387
388
|
switch (Platform.OS) {
|
|
388
|
-
case 'android':
|
|
389
|
-
|
|
389
|
+
case 'android': {
|
|
390
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
391
|
+
return Promise.reject('UIManager.dispatchViewManagerCommand is unavailable on this React Native version')
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const commandId = this._uiManagerCommand(name)
|
|
395
|
+
if (commandId == null) {
|
|
396
|
+
return Promise.reject(`Cannot find native command "${name}" for RMFMapView`)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return UIManager.dispatchViewManagerCommand(
|
|
390
400
|
this._getHandle(),
|
|
391
|
-
|
|
401
|
+
commandId,
|
|
392
402
|
args
|
|
393
403
|
);
|
|
404
|
+
}
|
|
394
405
|
|
|
395
406
|
case 'ios':
|
|
396
407
|
return this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -401,16 +412,21 @@ class MFMapView extends React.Component {
|
|
|
401
412
|
}
|
|
402
413
|
|
|
403
414
|
_uiManagerCommand(name) {
|
|
404
|
-
const
|
|
415
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
405
416
|
const componentName = "RMFMapView";
|
|
406
417
|
|
|
407
|
-
if (!
|
|
418
|
+
if (!uiManager) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (!uiManager.getViewManagerConfig) {
|
|
408
423
|
// RN < 0.58
|
|
409
|
-
return
|
|
424
|
+
return uiManager[componentName].Commands[name];
|
|
410
425
|
}
|
|
411
426
|
|
|
412
427
|
// RN >= 0.58
|
|
413
|
-
|
|
428
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
429
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
414
430
|
}
|
|
415
431
|
|
|
416
432
|
_mapManagerCommand(name) {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
StyleSheet,
|
|
7
7
|
Platform,
|
|
8
8
|
Image,
|
|
9
|
+
UIManager,
|
|
9
10
|
NativeModules,
|
|
10
11
|
findNodeHandle
|
|
11
12
|
} from 'react-native';
|
|
@@ -172,13 +173,19 @@ class MFMarker extends React.Component {
|
|
|
172
173
|
|
|
173
174
|
_runCommand(name, args) {
|
|
174
175
|
switch (Platform.OS) {
|
|
175
|
-
case 'android':
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
);
|
|
176
|
+
case 'android': {
|
|
177
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const commandId = this._uiManagerCommand(name);
|
|
182
|
+
if (commandId == null) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
181
187
|
break;
|
|
188
|
+
}
|
|
182
189
|
|
|
183
190
|
case 'ios':
|
|
184
191
|
//this.getMapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -191,16 +198,22 @@ class MFMarker extends React.Component {
|
|
|
191
198
|
}
|
|
192
199
|
|
|
193
200
|
_uiManagerCommand(name) {
|
|
194
|
-
const
|
|
201
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
195
202
|
const componentName = "RMFMarker";
|
|
203
|
+
|
|
204
|
+
if (!uiManager) {
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
196
207
|
|
|
197
|
-
if (!
|
|
208
|
+
if (!uiManager.getViewManagerConfig) {
|
|
198
209
|
// RN < 0.58
|
|
199
|
-
|
|
210
|
+
const legacyConfig = uiManager[componentName];
|
|
211
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
200
212
|
}
|
|
201
213
|
|
|
202
214
|
// RN >= 0.58
|
|
203
|
-
|
|
215
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
216
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
204
217
|
}
|
|
205
218
|
|
|
206
219
|
_mapManagerCommand(name) {
|
package/src/components/MFPOI.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
requireNativeComponent,
|
|
6
6
|
Platform,
|
|
7
7
|
Image,
|
|
8
|
+
UIManager,
|
|
8
9
|
NativeModules,
|
|
9
10
|
findNodeHandle,
|
|
10
11
|
processColor
|
|
@@ -128,13 +129,19 @@ class MFPOI extends React.Component {
|
|
|
128
129
|
|
|
129
130
|
_runCommand(name, args) {
|
|
130
131
|
switch (Platform.OS) {
|
|
131
|
-
case 'android':
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
);
|
|
132
|
+
case 'android': {
|
|
133
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const commandId = this._uiManagerCommand(name);
|
|
138
|
+
if (commandId == null) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
137
143
|
break;
|
|
144
|
+
}
|
|
138
145
|
|
|
139
146
|
case 'ios':
|
|
140
147
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -146,16 +153,22 @@ class MFPOI extends React.Component {
|
|
|
146
153
|
}
|
|
147
154
|
|
|
148
155
|
_uiManagerCommand(name) {
|
|
149
|
-
const
|
|
156
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
150
157
|
const componentName = "RMFPOI";
|
|
151
158
|
|
|
152
|
-
if (!
|
|
159
|
+
if (!uiManager) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (!uiManager.getViewManagerConfig) {
|
|
153
164
|
// RN < 0.58
|
|
154
|
-
|
|
165
|
+
const legacyConfig = uiManager[componentName];
|
|
166
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
155
167
|
}
|
|
156
168
|
|
|
157
169
|
// RN >= 0.58
|
|
158
|
-
|
|
170
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
171
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
159
172
|
}
|
|
160
173
|
|
|
161
174
|
_mapManagerCommand(name) {
|
|
@@ -4,6 +4,7 @@ import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
|
4
4
|
import {
|
|
5
5
|
requireNativeComponent,
|
|
6
6
|
Platform,
|
|
7
|
+
UIManager,
|
|
7
8
|
NativeModules,
|
|
8
9
|
findNodeHandle,
|
|
9
10
|
processColor
|
|
@@ -136,13 +137,19 @@ class MFPolygon extends React.Component {
|
|
|
136
137
|
|
|
137
138
|
_runCommand(name, args) {
|
|
138
139
|
switch (Platform.OS) {
|
|
139
|
-
case 'android':
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
);
|
|
140
|
+
case 'android': {
|
|
141
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const commandId = this._uiManagerCommand(name);
|
|
146
|
+
if (commandId == null) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
145
151
|
break;
|
|
152
|
+
}
|
|
146
153
|
|
|
147
154
|
case 'ios':
|
|
148
155
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -154,16 +161,22 @@ class MFPolygon extends React.Component {
|
|
|
154
161
|
}
|
|
155
162
|
|
|
156
163
|
_uiManagerCommand(name) {
|
|
157
|
-
const
|
|
164
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
158
165
|
const componentName = "RMFPolygon";
|
|
159
166
|
|
|
160
|
-
if (!
|
|
167
|
+
if (!uiManager) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (!uiManager.getViewManagerConfig) {
|
|
161
172
|
// RN < 0.58
|
|
162
|
-
|
|
173
|
+
const legacyConfig = uiManager[componentName];
|
|
174
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
163
175
|
}
|
|
164
176
|
|
|
165
177
|
// RN >= 0.58
|
|
166
|
-
|
|
178
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
179
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
167
180
|
}
|
|
168
181
|
|
|
169
182
|
_mapManagerCommand(name) {
|
|
@@ -4,6 +4,7 @@ import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
|
4
4
|
import {
|
|
5
5
|
requireNativeComponent,
|
|
6
6
|
Platform,
|
|
7
|
+
UIManager,
|
|
7
8
|
NativeModules,
|
|
8
9
|
findNodeHandle,
|
|
9
10
|
processColor
|
|
@@ -122,13 +123,19 @@ class MFPolyline extends React.Component {
|
|
|
122
123
|
|
|
123
124
|
_runCommand(name, args) {
|
|
124
125
|
switch (Platform.OS) {
|
|
125
|
-
case 'android':
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
);
|
|
126
|
+
case 'android': {
|
|
127
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const commandId = this._uiManagerCommand(name);
|
|
132
|
+
if (commandId == null) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
131
137
|
break;
|
|
138
|
+
}
|
|
132
139
|
|
|
133
140
|
case 'ios':
|
|
134
141
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -140,16 +147,22 @@ class MFPolyline extends React.Component {
|
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
_uiManagerCommand(name) {
|
|
143
|
-
const
|
|
150
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
144
151
|
const componentName = "RMFPolyline";
|
|
145
152
|
|
|
146
|
-
if (!
|
|
153
|
+
if (!uiManager) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (!uiManager.getViewManagerConfig) {
|
|
147
158
|
// RN < 0.58
|
|
148
|
-
|
|
159
|
+
const legacyConfig = uiManager[componentName];
|
|
160
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
149
161
|
}
|
|
150
162
|
|
|
151
163
|
// RN >= 0.58
|
|
152
|
-
|
|
164
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
165
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
153
166
|
}
|
|
154
167
|
|
|
155
168
|
_mapManagerCommand(name) {
|