react-native-map4d-map-dtqg 0.1.4 → 0.1.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.
- package/README.md +58 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/build.gradle +23 -2
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +39 -27
- package/ios/Map4dMap.h +12 -3
- package/ios/Map4dMap.m +108 -3
- package/ios/Map4dMapTurbo.mm +16 -0
- package/ios/RMFCircleManager.m +40 -68
- package/ios/RMFDirectionsRendererManager.m +26 -24
- package/ios/RMFMapViewManager.m +64 -149
- package/ios/RMFMarkerManager.m +36 -64
- package/ios/RMFPOIManager.m +40 -74
- package/ios/RMFPolygonManager.m +38 -60
- package/ios/RMFPolylineManager.m +36 -58
- package/ios/building/RMFBuildingManager.m +36 -64
- package/lib/commonjs/components/MFBanDoSo/constants.js +30 -0
- package/lib/commonjs/components/MFBanDoSo/constants.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/helpers.js +200 -0
- package/lib/commonjs/components/MFBanDoSo/helpers.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/propTypes.js +18 -0
- package/lib/commonjs/components/MFBanDoSo/propTypes.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/styles.js +334 -0
- package/lib/commonjs/components/MFBanDoSo/styles.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/ui.js +231 -0
- package/lib/commonjs/components/MFBanDoSo/ui.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo.js +201 -73
- package/lib/commonjs/components/MFBanDoSo.js.map +1 -1
- package/lib/commonjs/components/MFBuilding.js +15 -90
- package/lib/commonjs/components/MFBuilding.js.map +1 -1
- package/lib/commonjs/components/MFCircle.js +20 -88
- package/lib/commonjs/components/MFCircle.js.map +1 -1
- package/lib/commonjs/components/MFDirectionsRenderer.js +15 -93
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/commonjs/components/MFMapView.js +50 -147
- package/lib/commonjs/components/MFMapView.js.map +1 -1
- package/lib/commonjs/components/MFMarker.js +15 -101
- package/lib/commonjs/components/MFMarker.js.map +1 -1
- package/lib/commonjs/components/MFPOI.js +17 -92
- package/lib/commonjs/components/MFPOI.js.map +1 -1
- package/lib/commonjs/components/MFPolygon.js +15 -87
- package/lib/commonjs/components/MFPolygon.js.map +1 -1
- package/lib/commonjs/components/MFPolyline.js +17 -87
- package/lib/commonjs/components/MFPolyline.js.map +1 -1
- package/lib/commonjs/components/MFTileOverlay.js +7 -15
- package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
- package/lib/commonjs/components/Map4dMapView.js +1 -4
- package/lib/commonjs/components/Map4dMapView.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocusManager.js +4 -38
- package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocuser.js +1 -17
- package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
- package/lib/commonjs/components/extends/BoundHelper.js +0 -6
- package/lib/commonjs/components/extends/BoundHelper.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js +0 -37
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js +1 -35
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusSession.js +0 -18
- package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js +2 -3
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -1
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js +1 -2
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -1
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js +20 -31
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -1
- package/lib/commonjs/index.js +0 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native/Map4dMapNativeModule.js +10 -0
- package/lib/commonjs/native/Map4dMapNativeModule.js.map +1 -0
- package/lib/commonjs/native/NativeModuleResolver.js +35 -0
- package/lib/commonjs/native/NativeModuleResolver.js.map +1 -0
- package/lib/commonjs/native/ViewManagerCommand.js +67 -0
- package/lib/commonjs/native/ViewManagerCommand.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/NativeMap4dMap.js +9 -0
- package/lib/commonjs/specs/NativeMap4dMap.js.map +1 -0
- package/lib/module/components/MFBanDoSo/constants.js +25 -0
- package/lib/module/components/MFBanDoSo/constants.js.map +1 -0
- package/lib/module/components/MFBanDoSo/helpers.js +188 -0
- package/lib/module/components/MFBanDoSo/helpers.js.map +1 -0
- package/lib/module/components/MFBanDoSo/propTypes.js +14 -0
- package/lib/module/components/MFBanDoSo/propTypes.js.map +1 -0
- package/lib/module/components/MFBanDoSo/styles.js +332 -0
- package/lib/module/components/MFBanDoSo/styles.js.map +1 -0
- package/lib/module/components/MFBanDoSo/ui.js +224 -0
- package/lib/module/components/MFBanDoSo/ui.js.map +1 -0
- package/lib/module/components/MFBanDoSo.js +203 -63
- package/lib/module/components/MFBanDoSo.js.map +1 -1
- package/lib/module/components/MFBuilding.js +17 -82
- package/lib/module/components/MFBuilding.js.map +1 -1
- package/lib/module/components/MFCircle.js +22 -80
- package/lib/module/components/MFCircle.js.map +1 -1
- package/lib/module/components/MFDirectionsRenderer.js +16 -85
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/module/components/MFMapView.js +51 -136
- package/lib/module/components/MFMapView.js.map +1 -1
- package/lib/module/components/MFMarker.js +17 -92
- package/lib/module/components/MFMarker.js.map +1 -1
- package/lib/module/components/MFPOI.js +19 -84
- package/lib/module/components/MFPOI.js.map +1 -1
- package/lib/module/components/MFPolygon.js +17 -79
- package/lib/module/components/MFPolygon.js.map +1 -1
- package/lib/module/components/MFPolyline.js +19 -79
- package/lib/module/components/MFPolyline.js.map +1 -1
- package/lib/module/components/MFTileOverlay.js +10 -9
- package/lib/module/components/MFTileOverlay.js.map +1 -1
- package/lib/module/components/Map4dMapView.js +2 -0
- package/lib/module/components/Map4dMapView.js.map +1 -1
- package/lib/module/components/extends/AreaFocusManager.js +6 -32
- package/lib/module/components/extends/AreaFocusManager.js.map +1 -1
- package/lib/module/components/extends/AreaFocuser.js +3 -15
- package/lib/module/components/extends/AreaFocuser.js.map +1 -1
- package/lib/module/components/extends/BoundHelper.js +2 -5
- package/lib/module/components/extends/BoundHelper.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusAreas.js +2 -33
- package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js +2 -32
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusSession.js +2 -17
- package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusTypes.js +3 -0
- package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -1
- package/lib/module/components/internal/DefaultRoadmapStyle.js +2 -0
- package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -1
- package/lib/module/components/internal/GeojsonStyleUtils.js +21 -28
- package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/Map4dMapNativeModule.js +5 -0
- package/lib/module/native/Map4dMapNativeModule.js.map +1 -0
- package/lib/module/native/NativeModuleResolver.js +29 -0
- package/lib/module/native/NativeModuleResolver.js.map +1 -0
- package/lib/module/native/ViewManagerCommand.js +61 -0
- package/lib/module/native/ViewManagerCommand.js.map +1 -0
- package/lib/module/specs/NativeMap4dMap.js +5 -0
- package/lib/module/specs/NativeMap4dMap.js.map +1 -0
- package/lib/typescript/components/MFBanDoSo/constants.d.ts +11 -0
- package/lib/typescript/components/MFBanDoSo/constants.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/helpers.d.ts +14 -0
- package/lib/typescript/components/MFBanDoSo/helpers.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/propTypes.d.ts +2 -0
- package/lib/typescript/components/MFBanDoSo/propTypes.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/styles.d.ts +336 -0
- package/lib/typescript/components/MFBanDoSo/styles.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/ui.d.ts +32 -0
- package/lib/typescript/components/MFBanDoSo/ui.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo.d.ts +38 -0
- package/lib/typescript/components/MFBanDoSo.d.ts.map +1 -0
- package/lib/typescript/components/MFBuilding.d.ts +24 -0
- package/lib/typescript/components/MFBuilding.d.ts.map +1 -0
- package/lib/typescript/components/MFCircle.d.ts +24 -0
- package/lib/typescript/components/MFCircle.d.ts.map +1 -0
- package/lib/typescript/components/MFDirectionsRenderer.d.ts +19 -0
- package/lib/typescript/components/MFDirectionsRenderer.d.ts.map +1 -0
- package/lib/typescript/components/MFMapView.d.ts +66 -0
- package/lib/typescript/components/MFMapView.d.ts.map +1 -0
- package/lib/typescript/components/MFMarker.d.ts +26 -0
- package/lib/typescript/components/MFMarker.d.ts.map +1 -0
- package/lib/typescript/components/MFPOI.d.ts +24 -0
- package/lib/typescript/components/MFPOI.d.ts.map +1 -0
- package/lib/typescript/components/MFPolygon.d.ts +24 -0
- package/lib/typescript/components/MFPolygon.d.ts.map +1 -0
- package/lib/typescript/components/MFPolyline.d.ts +24 -0
- package/lib/typescript/components/MFPolyline.d.ts.map +1 -0
- package/lib/typescript/components/MFTileOverlay.d.ts +12 -0
- package/lib/typescript/components/MFTileOverlay.d.ts.map +1 -0
- package/lib/typescript/components/Map4dMapView.d.ts +8 -7
- package/lib/typescript/components/Map4dMapView.d.ts.map +1 -0
- package/lib/typescript/components/extends/AreaFocusManager.d.ts +34 -0
- package/lib/typescript/components/extends/AreaFocusManager.d.ts.map +1 -0
- package/lib/typescript/components/extends/AreaFocuser.d.ts +15 -0
- package/lib/typescript/components/extends/AreaFocuser.d.ts.map +1 -0
- package/lib/typescript/components/extends/BoundHelper.d.ts +11 -0
- package/lib/typescript/components/extends/BoundHelper.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusAreas.d.ts +58 -0
- package/lib/typescript/components/extends/area/AreaFocusAreas.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusGeometryUtils.d.ts +19 -0
- package/lib/typescript/components/extends/area/AreaFocusGeometryUtils.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusSession.d.ts +14 -0
- package/lib/typescript/components/extends/area/AreaFocusSession.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusTypes.d.ts +40 -0
- package/lib/typescript/components/extends/area/AreaFocusTypes.d.ts.map +1 -0
- package/lib/typescript/components/internal/DefaultRoadmapStyle.d.ts +820 -0
- package/lib/typescript/components/internal/DefaultRoadmapStyle.d.ts.map +1 -0
- package/lib/typescript/components/internal/GeojsonStyleUtils.d.ts +3 -0
- package/lib/typescript/components/internal/GeojsonStyleUtils.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +13 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/native/Map4dMapNativeModule.d.ts +2 -0
- package/lib/typescript/native/Map4dMapNativeModule.d.ts.map +1 -0
- package/lib/typescript/native/NativeModuleResolver.d.ts +3 -0
- package/lib/typescript/native/NativeModuleResolver.d.ts.map +1 -0
- package/lib/typescript/native/ViewManagerCommand.d.ts +11 -0
- package/lib/typescript/native/ViewManagerCommand.d.ts.map +1 -0
- package/package.json +27 -11
- package/src/components/MFBanDoSo/constants.js +38 -0
- package/src/components/MFBanDoSo/helpers.js +273 -0
- package/src/components/MFBanDoSo/propTypes.js +14 -0
- package/src/components/MFBanDoSo/styles.js +323 -0
- package/src/components/MFBanDoSo/ui.js +261 -0
- package/src/components/MFBanDoSo.js +280 -78
- package/src/components/MFBuilding.js +8 -48
- package/src/components/MFCircle.js +8 -48
- package/src/components/MFDirectionsRenderer.js +8 -47
- package/src/components/MFMapView.js +31 -53
- package/src/components/MFMarker.js +9 -50
- package/src/components/MFPOI.js +8 -48
- package/src/components/MFPolygon.js +8 -48
- package/src/components/MFPolyline.js +8 -48
- package/src/components/internal/GeojsonStyleUtils.js +3 -0
- package/src/native/Map4dMapNativeModule.js +3 -0
- package/src/native/NativeModuleResolver.js +33 -0
- package/src/native/ViewManagerCommand.js +82 -0
- package/src/specs/NativeMap4dMap.js +12 -0
- package/ios/Map4dMapViewManager.m +0 -34
|
@@ -4,11 +4,11 @@ import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
|
4
4
|
import {AreaFocusManager} from './extends/AreaFocusManager';
|
|
5
5
|
import {AreaFocuser} from './extends/AreaFocuser';
|
|
6
6
|
import {MFPolygon} from './MFPolygon';
|
|
7
|
+
import {getMap4dMapNativeModule} from '../native/Map4dMapNativeModule';
|
|
8
|
+
import {runViewManagerCommand} from '../native/ViewManagerCommand';
|
|
7
9
|
import {
|
|
8
10
|
requireNativeComponent,
|
|
9
11
|
Platform,
|
|
10
|
-
UIManager,
|
|
11
|
-
NativeModules,
|
|
12
12
|
findNodeHandle
|
|
13
13
|
} from 'react-native';
|
|
14
14
|
|
|
@@ -231,7 +231,7 @@ class MFMapView extends React.Component {
|
|
|
231
231
|
|
|
232
232
|
getCamera() {
|
|
233
233
|
if (Platform.OS === 'android') {
|
|
234
|
-
return
|
|
234
|
+
return this._runMap4dMapModuleMethod('getCamera', [this._getHandle()]);
|
|
235
235
|
} else if (Platform.OS === 'ios') {
|
|
236
236
|
return this._runCommand('getCamera', []);
|
|
237
237
|
}
|
|
@@ -240,7 +240,7 @@ class MFMapView extends React.Component {
|
|
|
240
240
|
|
|
241
241
|
getBounds() {
|
|
242
242
|
if (Platform.OS === 'android') {
|
|
243
|
-
return
|
|
243
|
+
return this._runMap4dMapModuleMethod('getBounds', [this._getHandle()]);
|
|
244
244
|
} else if (Platform.OS === 'ios') {
|
|
245
245
|
return this._runCommand('getBounds', []);
|
|
246
246
|
}
|
|
@@ -249,7 +249,7 @@ class MFMapView extends React.Component {
|
|
|
249
249
|
|
|
250
250
|
getMyLocation() {
|
|
251
251
|
if (Platform.OS === 'android') {
|
|
252
|
-
return
|
|
252
|
+
return this._runMap4dMapModuleMethod('getMyLocation', [this._getHandle()]);
|
|
253
253
|
} else if (Platform.OS === 'ios') {
|
|
254
254
|
return this._runCommand('getMyLocation', []);
|
|
255
255
|
}
|
|
@@ -312,10 +312,10 @@ class MFMapView extends React.Component {
|
|
|
312
312
|
|
|
313
313
|
cameraForBounds(boundsData) {
|
|
314
314
|
if (Platform.OS === 'android') {
|
|
315
|
-
return
|
|
315
|
+
return this._runMap4dMapModuleMethod('cameraForBounds', [
|
|
316
316
|
this._getHandle(),
|
|
317
317
|
boundsData
|
|
318
|
-
);
|
|
318
|
+
]);
|
|
319
319
|
} else if (Platform.OS === 'ios') {
|
|
320
320
|
return this._runCommand('cameraForBounds', [boundsData]);
|
|
321
321
|
}
|
|
@@ -334,10 +334,10 @@ class MFMapView extends React.Component {
|
|
|
334
334
|
*/
|
|
335
335
|
pointForCoordinate(coordinate) {
|
|
336
336
|
if (Platform.OS === 'android') {
|
|
337
|
-
return
|
|
337
|
+
return this._runMap4dMapModuleMethod('pointForCoordinate', [
|
|
338
338
|
this._getHandle(),
|
|
339
339
|
coordinate
|
|
340
|
-
);
|
|
340
|
+
]);
|
|
341
341
|
} else if (Platform.OS === 'ios') {
|
|
342
342
|
return this._runCommand('pointForCoordinate', [coordinate]);
|
|
343
343
|
}
|
|
@@ -355,10 +355,10 @@ class MFMapView extends React.Component {
|
|
|
355
355
|
*/
|
|
356
356
|
coordinateForPoint(point) {
|
|
357
357
|
if (Platform.OS === 'android') {
|
|
358
|
-
return
|
|
358
|
+
return this._runMap4dMapModuleMethod('coordinateForPoint', [
|
|
359
359
|
this._getHandle(),
|
|
360
360
|
point
|
|
361
|
-
);
|
|
361
|
+
]);
|
|
362
362
|
} else if (Platform.OS === 'ios') {
|
|
363
363
|
return this._runCommand('coordinateForPoint', [point]);
|
|
364
364
|
}
|
|
@@ -384,53 +384,31 @@ class MFMapView extends React.Component {
|
|
|
384
384
|
return findNodeHandle(this.map);
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
|
|
388
|
-
|
|
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(
|
|
400
|
-
this._getHandle(),
|
|
401
|
-
commandId,
|
|
402
|
-
args
|
|
403
|
-
);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
case 'ios':
|
|
407
|
-
return this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
408
|
-
|
|
409
|
-
default:
|
|
410
|
-
return Promise.reject(`Invalid platform was passed: ${Platform.OS}`);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
_uiManagerCommand(name) {
|
|
415
|
-
const uiManager = UIManager || NativeModules.UIManager;
|
|
416
|
-
const componentName = "RMFMapView";
|
|
417
|
-
|
|
418
|
-
if (!uiManager) {
|
|
419
|
-
return null;
|
|
420
|
-
}
|
|
387
|
+
_runMap4dMapModuleMethod(name, args) {
|
|
388
|
+
const map4dMapNativeModule = getMap4dMapNativeModule();
|
|
421
389
|
|
|
422
|
-
if (
|
|
423
|
-
|
|
424
|
-
|
|
390
|
+
if (
|
|
391
|
+
!map4dMapNativeModule ||
|
|
392
|
+
typeof map4dMapNativeModule[name] !== 'function'
|
|
393
|
+
) {
|
|
394
|
+
return Promise.reject(
|
|
395
|
+
`Map4dMap native method "${name}" is unavailable`
|
|
396
|
+
);
|
|
425
397
|
}
|
|
426
398
|
|
|
427
|
-
|
|
428
|
-
const config = uiManager.getViewManagerConfig(componentName);
|
|
429
|
-
return config && config.Commands ? config.Commands[name] : null;
|
|
399
|
+
return map4dMapNativeModule[name](...args);
|
|
430
400
|
}
|
|
431
401
|
|
|
432
|
-
|
|
433
|
-
return
|
|
402
|
+
_runCommand(name, args) {
|
|
403
|
+
return runViewManagerCommand({
|
|
404
|
+
componentName: 'RMFMapView',
|
|
405
|
+
moduleName: 'RMFMapView',
|
|
406
|
+
commandName: name,
|
|
407
|
+
args,
|
|
408
|
+
reactTag: this._getHandle(),
|
|
409
|
+
platform: Platform.OS,
|
|
410
|
+
rejectOnError: true,
|
|
411
|
+
});
|
|
434
412
|
}
|
|
435
413
|
|
|
436
414
|
render() {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import {ViewPropTypes} from 'deprecated-react-native-prop-types';
|
|
4
|
+
import {runViewManagerCommand} from '../native/ViewManagerCommand';
|
|
4
5
|
import {
|
|
5
6
|
requireNativeComponent,
|
|
6
7
|
StyleSheet,
|
|
7
|
-
Platform,
|
|
8
8
|
Image,
|
|
9
|
-
UIManager,
|
|
10
|
-
NativeModules,
|
|
11
9
|
findNodeHandle
|
|
12
10
|
} from 'react-native';
|
|
13
11
|
|
|
@@ -172,53 +170,14 @@ class MFMarker extends React.Component {
|
|
|
172
170
|
|
|
173
171
|
|
|
174
172
|
_runCommand(name, args) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
case 'ios':
|
|
191
|
-
//this.getMapManagerCommand(name)(this._getHandle(), ...args);
|
|
192
|
-
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
193
|
-
break;
|
|
194
|
-
|
|
195
|
-
default:
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
_uiManagerCommand(name) {
|
|
201
|
-
const uiManager = UIManager || NativeModules.UIManager;
|
|
202
|
-
const componentName = "RMFMarker";
|
|
203
|
-
|
|
204
|
-
if (!uiManager) {
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (!uiManager.getViewManagerConfig) {
|
|
209
|
-
// RN < 0.58
|
|
210
|
-
const legacyConfig = uiManager[componentName];
|
|
211
|
-
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// RN >= 0.58
|
|
215
|
-
const config = uiManager.getViewManagerConfig(componentName);
|
|
216
|
-
return config && config.Commands ? config.Commands[name] : null;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
_mapManagerCommand(name) {
|
|
220
|
-
return NativeModules[`RMFMarker`][name];
|
|
221
|
-
}
|
|
173
|
+
return runViewManagerCommand({
|
|
174
|
+
componentName: 'RMFMarker',
|
|
175
|
+
moduleName: 'RMFMarker',
|
|
176
|
+
commandName: name,
|
|
177
|
+
args,
|
|
178
|
+
reactTag: this._getHandle(),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
222
181
|
|
|
223
182
|
_onPress(event) {
|
|
224
183
|
event.stopPropagation();
|
package/src/components/MFPOI.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
4
|
+
import {runViewManagerCommand} from '../native/ViewManagerCommand';
|
|
4
5
|
import {
|
|
5
6
|
requireNativeComponent,
|
|
6
|
-
Platform,
|
|
7
7
|
Image,
|
|
8
|
-
UIManager,
|
|
9
|
-
NativeModules,
|
|
10
8
|
findNodeHandle,
|
|
11
9
|
processColor
|
|
12
10
|
} from 'react-native';
|
|
@@ -128,51 +126,13 @@ class MFPOI extends React.Component {
|
|
|
128
126
|
|
|
129
127
|
|
|
130
128
|
_runCommand(name, args) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (commandId == null) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
case 'ios':
|
|
147
|
-
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
148
|
-
break;
|
|
149
|
-
|
|
150
|
-
default:
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
_uiManagerCommand(name) {
|
|
156
|
-
const uiManager = UIManager || NativeModules.UIManager;
|
|
157
|
-
const componentName = "RMFPOI";
|
|
158
|
-
|
|
159
|
-
if (!uiManager) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (!uiManager.getViewManagerConfig) {
|
|
164
|
-
// RN < 0.58
|
|
165
|
-
const legacyConfig = uiManager[componentName];
|
|
166
|
-
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// RN >= 0.58
|
|
170
|
-
const config = uiManager.getViewManagerConfig(componentName);
|
|
171
|
-
return config && config.Commands ? config.Commands[name] : null;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
_mapManagerCommand(name) {
|
|
175
|
-
return NativeModules[`RMFPOI`][name];
|
|
129
|
+
return runViewManagerCommand({
|
|
130
|
+
componentName: 'RMFPOI',
|
|
131
|
+
moduleName: 'RMFPOI',
|
|
132
|
+
commandName: name,
|
|
133
|
+
args,
|
|
134
|
+
reactTag: this._getHandle(),
|
|
135
|
+
});
|
|
176
136
|
}
|
|
177
137
|
|
|
178
138
|
render() {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
4
|
+
import {runViewManagerCommand} from '../native/ViewManagerCommand';
|
|
4
5
|
import {
|
|
5
6
|
requireNativeComponent,
|
|
6
|
-
Platform,
|
|
7
|
-
UIManager,
|
|
8
|
-
NativeModules,
|
|
9
7
|
findNodeHandle,
|
|
10
8
|
processColor
|
|
11
9
|
} from 'react-native';
|
|
@@ -136,51 +134,13 @@ class MFPolygon extends React.Component {
|
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
_runCommand(name, args) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (commandId == null) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
case 'ios':
|
|
155
|
-
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
156
|
-
break;
|
|
157
|
-
|
|
158
|
-
default:
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
_uiManagerCommand(name) {
|
|
164
|
-
const uiManager = UIManager || NativeModules.UIManager;
|
|
165
|
-
const componentName = "RMFPolygon";
|
|
166
|
-
|
|
167
|
-
if (!uiManager) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (!uiManager.getViewManagerConfig) {
|
|
172
|
-
// RN < 0.58
|
|
173
|
-
const legacyConfig = uiManager[componentName];
|
|
174
|
-
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// RN >= 0.58
|
|
178
|
-
const config = uiManager.getViewManagerConfig(componentName);
|
|
179
|
-
return config && config.Commands ? config.Commands[name] : null;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
_mapManagerCommand(name) {
|
|
183
|
-
return NativeModules[`RMFPolygon`][name];
|
|
137
|
+
return runViewManagerCommand({
|
|
138
|
+
componentName: 'RMFPolygon',
|
|
139
|
+
moduleName: 'RMFPolygon',
|
|
140
|
+
commandName: name,
|
|
141
|
+
args,
|
|
142
|
+
reactTag: this._getHandle(),
|
|
143
|
+
});
|
|
184
144
|
}
|
|
185
145
|
|
|
186
146
|
render() {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
|
|
4
|
+
import {runViewManagerCommand} from '../native/ViewManagerCommand';
|
|
4
5
|
import {
|
|
5
6
|
requireNativeComponent,
|
|
6
|
-
Platform,
|
|
7
|
-
UIManager,
|
|
8
|
-
NativeModules,
|
|
9
7
|
findNodeHandle,
|
|
10
8
|
processColor
|
|
11
9
|
} from 'react-native';
|
|
@@ -122,51 +120,13 @@ class MFPolyline extends React.Component {
|
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
_runCommand(name, args) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (commandId == null) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
case 'ios':
|
|
141
|
-
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
142
|
-
break;
|
|
143
|
-
|
|
144
|
-
default:
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
_uiManagerCommand(name) {
|
|
150
|
-
const uiManager = UIManager || NativeModules.UIManager;
|
|
151
|
-
const componentName = "RMFPolyline";
|
|
152
|
-
|
|
153
|
-
if (!uiManager) {
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (!uiManager.getViewManagerConfig) {
|
|
158
|
-
// RN < 0.58
|
|
159
|
-
const legacyConfig = uiManager[componentName];
|
|
160
|
-
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// RN >= 0.58
|
|
164
|
-
const config = uiManager.getViewManagerConfig(componentName);
|
|
165
|
-
return config && config.Commands ? config.Commands[name] : null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
_mapManagerCommand(name) {
|
|
169
|
-
return NativeModules[`RMFPolyline`][name];
|
|
123
|
+
return runViewManagerCommand({
|
|
124
|
+
componentName: 'RMFPolyline',
|
|
125
|
+
moduleName: 'RMFPolyline',
|
|
126
|
+
commandName: name,
|
|
127
|
+
args,
|
|
128
|
+
reactTag: this._getHandle(),
|
|
129
|
+
});
|
|
170
130
|
}
|
|
171
131
|
|
|
172
132
|
render() {
|
|
@@ -50,6 +50,7 @@ function generateLayerStyle(source, items) {
|
|
|
50
50
|
source_layer: line.layer,
|
|
51
51
|
filter: line.filter,
|
|
52
52
|
draw: line.draw,
|
|
53
|
+
metadata: { managedBy: 'MFBanDoSo' },
|
|
53
54
|
});
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -63,6 +64,7 @@ function generateLayerStyle(source, items) {
|
|
|
63
64
|
source_layer: fill.layer,
|
|
64
65
|
filter: fill.filter,
|
|
65
66
|
draw: fill.draw,
|
|
67
|
+
metadata: { managedBy: 'MFBanDoSo' },
|
|
66
68
|
});
|
|
67
69
|
});
|
|
68
70
|
}
|
|
@@ -76,6 +78,7 @@ function generateLayerStyle(source, items) {
|
|
|
76
78
|
source_layer: symbol.layer,
|
|
77
79
|
filter: symbol.filter,
|
|
78
80
|
draw: symbol.draw,
|
|
81
|
+
metadata: { managedBy: 'MFBanDoSo' },
|
|
79
82
|
});
|
|
80
83
|
});
|
|
81
84
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const getReactNative = () => require('react-native');
|
|
2
|
+
|
|
3
|
+
export const getNativeModule = (moduleName) => {
|
|
4
|
+
const reactNative = getReactNative();
|
|
5
|
+
const turboRegistry = reactNative && reactNative.TurboModuleRegistry;
|
|
6
|
+
|
|
7
|
+
if (turboRegistry && typeof turboRegistry.get === 'function') {
|
|
8
|
+
const turboModule = turboRegistry.get(moduleName);
|
|
9
|
+
if (turboModule) {
|
|
10
|
+
return turboModule;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const nativeModules = reactNative && reactNative.NativeModules;
|
|
15
|
+
if (!nativeModules) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return nativeModules[moduleName] || null;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const getUIManager = () => {
|
|
23
|
+
const reactNative = getReactNative();
|
|
24
|
+
if (!reactNative) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (reactNative.UIManager) {
|
|
29
|
+
return reactNative.UIManager;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return reactNative.NativeModules ? reactNative.NativeModules.UIManager : null;
|
|
33
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {Platform, UIManager} from 'react-native';
|
|
2
|
+
import {getNativeModule, getUIManager} from './NativeModuleResolver';
|
|
3
|
+
|
|
4
|
+
const rejectOrIgnore = (message, rejectOnError) => {
|
|
5
|
+
if (rejectOnError) {
|
|
6
|
+
return Promise.reject(message);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const getViewManagerCommandId = (componentName, commandName) => {
|
|
13
|
+
const uiManager = UIManager || getUIManager();
|
|
14
|
+
|
|
15
|
+
if (!uiManager) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!uiManager.getViewManagerConfig) {
|
|
20
|
+
// RN < 0.58
|
|
21
|
+
const legacyConfig = uiManager[componentName];
|
|
22
|
+
return legacyConfig && legacyConfig.Commands
|
|
23
|
+
? legacyConfig.Commands[commandName]
|
|
24
|
+
: null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// RN >= 0.58
|
|
28
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
29
|
+
return config && config.Commands ? config.Commands[commandName] : null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const runViewManagerCommand = ({
|
|
33
|
+
componentName,
|
|
34
|
+
moduleName,
|
|
35
|
+
commandName,
|
|
36
|
+
args = [],
|
|
37
|
+
reactTag,
|
|
38
|
+
platform = Platform.OS,
|
|
39
|
+
rejectOnError = false,
|
|
40
|
+
}) => {
|
|
41
|
+
switch (platform) {
|
|
42
|
+
case 'android': {
|
|
43
|
+
const uiManager = UIManager || getUIManager();
|
|
44
|
+
if (!uiManager || typeof uiManager.dispatchViewManagerCommand !== 'function') {
|
|
45
|
+
return rejectOrIgnore(
|
|
46
|
+
'UIManager.dispatchViewManagerCommand is unavailable on this React Native version',
|
|
47
|
+
rejectOnError
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const commandId = getViewManagerCommandId(componentName, commandName);
|
|
52
|
+
if (commandId == null) {
|
|
53
|
+
return rejectOrIgnore(
|
|
54
|
+
`Cannot find native command "${commandName}" for ${componentName}`,
|
|
55
|
+
rejectOnError
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return uiManager.dispatchViewManagerCommand(reactTag, commandId, args);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
case 'ios': {
|
|
63
|
+
const mapManager = getNativeModule(moduleName || componentName);
|
|
64
|
+
const mapManagerCommand = mapManager ? mapManager[commandName] : null;
|
|
65
|
+
|
|
66
|
+
if (typeof mapManagerCommand !== 'function') {
|
|
67
|
+
return rejectOrIgnore(
|
|
68
|
+
`Cannot find native command "${commandName}" for ${componentName}`,
|
|
69
|
+
rejectOnError
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return mapManagerCommand(reactTag, ...args);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
default:
|
|
77
|
+
return rejectOrIgnore(
|
|
78
|
+
`Invalid platform was passed: ${platform}`,
|
|
79
|
+
rejectOnError
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {TurboModuleRegistry} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface Spec {
|
|
4
|
+
getCamera(reactTag: number): Promise<Object>;
|
|
5
|
+
getBounds(reactTag: number): Promise<Object>;
|
|
6
|
+
getMyLocation(reactTag: number): Promise<Object>;
|
|
7
|
+
pointForCoordinate(reactTag: number, coordinate: Object): Promise<Object>;
|
|
8
|
+
coordinateForPoint(reactTag: number, point: Object): Promise<Object>;
|
|
9
|
+
cameraForBounds(reactTag: number, boundsData: Object): Promise<Object>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default TurboModuleRegistry.get<Spec>('Map4dMap');
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#import <React/RCTViewManager.h>
|
|
2
|
-
|
|
3
|
-
@interface Map4dMapViewManager : RCTViewManager
|
|
4
|
-
@end
|
|
5
|
-
|
|
6
|
-
@implementation Map4dMapViewManager
|
|
7
|
-
|
|
8
|
-
RCT_EXPORT_MODULE(Map4dMapView)
|
|
9
|
-
|
|
10
|
-
- (UIView *)view
|
|
11
|
-
{
|
|
12
|
-
return [[UIView alloc] init];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView)
|
|
16
|
-
{
|
|
17
|
-
[view setBackgroundColor:[self hexStringToColor:json]];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
- hexStringToColor:(NSString *)stringToConvert
|
|
21
|
-
{
|
|
22
|
-
NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
|
|
23
|
-
NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
|
|
24
|
-
|
|
25
|
-
unsigned hex;
|
|
26
|
-
if (![stringScanner scanHexInt:&hex]) return nil;
|
|
27
|
-
int r = (hex >> 16) & 0xFF;
|
|
28
|
-
int g = (hex >> 8) & 0xFF;
|
|
29
|
-
int b = (hex) & 0xFF;
|
|
30
|
-
|
|
31
|
-
return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@end
|