@aguacerowx/react-native 0.0.53 → 0.0.54
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/LICENSE +21 -0
- package/android/src/main/java/com/aguacerowx/reactnative/NexradRadarLayerView.java +14 -2
- package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +77 -0
- package/index.js +1 -1
- package/ios/WeatherFrameProcessorModule.m +19 -15
- package/ios/WeatherFrameProcessorModule.swift +65 -0
- package/lib/commonjs/AguaceroContext.js +0 -4
- package/lib/commonjs/AguaceroContext.js.map +1 -1
- package/lib/commonjs/GridRenderLayer.js +62 -76
- package/lib/commonjs/GridRenderLayer.js.map +1 -1
- package/lib/commonjs/MapManager.js +110 -224
- package/lib/commonjs/MapManager.js.map +1 -1
- package/lib/commonjs/MapRegistry.js +21 -33
- package/lib/commonjs/MapRegistry.js.map +1 -1
- package/lib/commonjs/NexradRadarLayer.android.js +28 -100
- package/lib/commonjs/NexradRadarLayer.android.js.map +1 -1
- package/lib/commonjs/NexradRadarLayer.ios.js +26 -97
- package/lib/commonjs/NexradRadarLayer.ios.js.map +1 -1
- package/lib/commonjs/NexradSitesMapLayer.js +41 -61
- package/lib/commonjs/NexradSitesMapLayer.js.map +1 -1
- package/lib/commonjs/SatelliteLayer.android.js +26 -38
- package/lib/commonjs/SatelliteLayer.android.js.map +1 -1
- package/lib/commonjs/SatelliteLayer.ios.js +30 -42
- package/lib/commonjs/SatelliteLayer.ios.js.map +1 -1
- package/lib/commonjs/StyleApplicator.js +129 -175
- package/lib/commonjs/StyleApplicator.js.map +1 -1
- package/lib/commonjs/WeatherLayerManager.js +995 -1646
- package/lib/commonjs/WeatherLayerManager.js.map +1 -1
- package/lib/commonjs/aguaceroCoreDebugHooks.js +58 -130
- package/lib/commonjs/aguaceroCoreDebugHooks.js.map +1 -1
- package/lib/commonjs/aguaceroRnDebug.js +147 -288
- package/lib/commonjs/aguaceroRnDebug.js.map +1 -1
- package/lib/commonjs/cdnAuthenticatedFetch.js +104 -0
- package/lib/commonjs/cdnAuthenticatedFetch.js.map +1 -0
- package/lib/commonjs/dispatchViewManagerCommandCompat.js +51 -88
- package/lib/commonjs/dispatchViewManagerCommandCompat.js.map +1 -1
- package/lib/commonjs/gridCdnAuth.js +41 -50
- package/lib/commonjs/gridCdnAuth.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nexrad/nexradAndroidController.js +851 -863
- package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
- package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/nexradDiag.js +32 -148
- package/lib/commonjs/nexrad/nexradDiag.js.map +1 -1
- package/lib/commonjs/nexrad/nexradLevel2Keys.js +261 -0
- package/lib/commonjs/nexrad/nexradLevel2Keys.js.map +1 -0
- package/lib/commonjs/nexrad/nexradLutBuild.js +64 -111
- package/lib/commonjs/nexrad/nexradLutBuild.js.map +1 -1
- package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js +136 -164
- package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/nexradSdkImports.js +51 -0
- package/lib/commonjs/nexrad/nexradSdkImports.js.map +1 -0
- package/lib/commonjs/nexrad/radarArchiveCore.bundled.js +2848 -4455
- package/lib/commonjs/nexrad/radarArchiveCore.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/radarDecode.worker.bundled.js +445 -648
- package/lib/commonjs/nexrad/radarDecode.worker.bundled.js.map +1 -1
- package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js +52 -68
- package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
- package/lib/commonjs/nexradNativeCommandIds.js +24 -0
- package/lib/commonjs/nexradNativeCommandIds.js.map +1 -0
- package/lib/commonjs/nws/NwsAlertsOverlay.android.js.map +1 -1
- package/lib/commonjs/nws/NwsAlertsOverlay.ios.js.map +1 -1
- package/lib/commonjs/nws/NwsAlertsOverlay.js +3 -3
- package/lib/commonjs/nws/NwsAlertsOverlay.js.map +1 -1
- package/lib/commonjs/nws/NwsAlertsOverlay.native.js +235 -361
- package/lib/commonjs/nws/NwsAlertsOverlay.native.js.map +1 -1
- package/lib/commonjs/nws/eventSourceRnPolyfill.js +92 -146
- package/lib/commonjs/nws/eventSourceRnPolyfill.js.map +1 -1
- package/lib/commonjs/nws/nwsAndroidConstants.js +2 -8
- package/lib/commonjs/nws/nwsAndroidConstants.js.map +1 -1
- package/lib/commonjs/satellite/satelliteAndroidController.js +117 -202
- package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/commonjs/satelliteBridgeDiag.js +3 -13
- package/lib/commonjs/satelliteBridgeDiag.js.map +1 -1
- package/lib/commonjs/satelliteRnDebug.js +117 -218
- package/lib/commonjs/satelliteRnDebug.js.map +1 -1
- package/lib/module/AguaceroContext.js +2 -7
- package/lib/module/AguaceroContext.js.map +1 -1
- package/lib/module/GridRenderLayer.js +66 -80
- package/lib/module/GridRenderLayer.js.map +1 -1
- package/lib/module/MapManager.js +125 -239
- package/lib/module/MapManager.js.map +1 -1
- package/lib/module/MapRegistry.js +21 -33
- package/lib/module/MapRegistry.js.map +1 -1
- package/lib/module/NexradRadarLayer.android.js +32 -104
- package/lib/module/NexradRadarLayer.android.js.map +1 -1
- package/lib/module/NexradRadarLayer.ios.js +30 -101
- package/lib/module/NexradRadarLayer.ios.js.map +1 -1
- package/lib/module/NexradSitesMapLayer.js +44 -63
- package/lib/module/NexradSitesMapLayer.js.map +1 -1
- package/lib/module/SatelliteLayer.android.js +32 -44
- package/lib/module/SatelliteLayer.android.js.map +1 -1
- package/lib/module/SatelliteLayer.ios.js +36 -48
- package/lib/module/SatelliteLayer.ios.js.map +1 -1
- package/lib/module/StyleApplicator.js +144 -191
- package/lib/module/StyleApplicator.js.map +1 -1
- package/lib/module/WeatherLayerManager.js +1024 -1675
- package/lib/module/WeatherLayerManager.js.map +1 -1
- package/lib/module/aguaceroCoreDebugHooks.js +59 -130
- package/lib/module/aguaceroCoreDebugHooks.js.map +1 -1
- package/lib/module/aguaceroRnDebug.js +151 -292
- package/lib/module/aguaceroRnDebug.js.map +1 -1
- package/lib/module/cdnAuthenticatedFetch.js +97 -0
- package/lib/module/cdnAuthenticatedFetch.js.map +1 -0
- package/lib/module/dispatchViewManagerCommandCompat.js +52 -90
- package/lib/module/dispatchViewManagerCommandCompat.js.map +1 -1
- package/lib/module/gridCdnAuth.js +38 -50
- package/lib/module/gridCdnAuth.js.map +1 -1
- package/lib/module/index.js +9 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/nexrad/nexradAndroidController.js +865 -876
- package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
- package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
- package/lib/module/nexrad/nexradDiag.js +31 -145
- package/lib/module/nexrad/nexradDiag.js.map +1 -1
- package/lib/module/nexrad/nexradLevel2Keys.js +245 -0
- package/lib/module/nexrad/nexradLevel2Keys.js.map +1 -0
- package/lib/module/nexrad/nexradLutBuild.js +64 -110
- package/lib/module/nexrad/nexradLutBuild.js.map +1 -1
- package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js +136 -163
- package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
- package/lib/module/nexrad/nexradSdkImports.js +4 -0
- package/lib/module/nexrad/nexradSdkImports.js.map +1 -0
- package/lib/module/nexrad/radarArchiveCore.bundled.js +2839 -4448
- package/lib/module/nexrad/radarArchiveCore.bundled.js.map +1 -1
- package/lib/module/nexrad/radarDecode.worker.bundled.js +445 -648
- package/lib/module/nexrad/radarDecode.worker.bundled.js.map +1 -1
- package/lib/module/nexrad/radarFrameGpuMatch.bundled.js +50 -66
- package/lib/module/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
- package/lib/module/nexradNativeCommandIds.js +18 -0
- package/lib/module/nexradNativeCommandIds.js.map +1 -0
- package/lib/module/nws/NwsAlertsOverlay.android.js +1 -1
- package/lib/module/nws/NwsAlertsOverlay.android.js.map +1 -1
- package/lib/module/nws/NwsAlertsOverlay.ios.js +1 -1
- package/lib/module/nws/NwsAlertsOverlay.ios.js.map +1 -1
- package/lib/module/nws/NwsAlertsOverlay.js +5 -5
- package/lib/module/nws/NwsAlertsOverlay.js.map +1 -1
- package/lib/module/nws/NwsAlertsOverlay.native.js +248 -373
- package/lib/module/nws/NwsAlertsOverlay.native.js.map +1 -1
- package/lib/module/nws/eventSourceRnPolyfill.js +92 -146
- package/lib/module/nws/eventSourceRnPolyfill.js.map +1 -1
- package/lib/module/nws/nwsAndroidConstants.js +2 -8
- package/lib/module/nws/nwsAndroidConstants.js.map +1 -1
- package/lib/module/satellite/satelliteAndroidController.js +123 -208
- package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/module/satelliteBridgeDiag.js +3 -13
- package/lib/module/satelliteBridgeDiag.js.map +1 -1
- package/lib/module/satelliteRnDebug.js +123 -223
- package/lib/module/satelliteRnDebug.js.map +1 -1
- package/lib/typescript/AguaceroContext.d.ts +0 -4
- package/lib/typescript/AguaceroContext.d.ts.map +1 -1
- package/lib/typescript/GridRenderLayer.d.ts.map +1 -1
- package/lib/typescript/MapManager.d.ts +0 -12
- package/lib/typescript/MapManager.d.ts.map +1 -1
- package/lib/typescript/MapRegistry.d.ts +10 -12
- package/lib/typescript/MapRegistry.d.ts.map +1 -1
- package/lib/typescript/NexradRadarLayer.android.d.ts.map +1 -1
- package/lib/typescript/NexradRadarLayer.ios.d.ts.map +1 -1
- package/lib/typescript/NexradSitesMapLayer.d.ts +4 -10
- package/lib/typescript/NexradSitesMapLayer.d.ts.map +1 -1
- package/lib/typescript/SatelliteLayer.android.d.ts.map +1 -1
- package/lib/typescript/SatelliteLayer.ios.d.ts.map +1 -1
- package/lib/typescript/StyleApplicator.d.ts +1 -1
- package/lib/typescript/StyleApplicator.d.ts.map +1 -1
- package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
- package/lib/typescript/aguaceroCoreDebugHooks.d.ts +2 -9
- package/lib/typescript/aguaceroCoreDebugHooks.d.ts.map +1 -1
- package/lib/typescript/aguaceroRnDebug.d.ts +47 -66
- package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -1
- package/lib/typescript/cdnAuthenticatedFetch.d.ts +10 -0
- package/lib/typescript/cdnAuthenticatedFetch.d.ts.map +1 -0
- package/lib/typescript/dispatchViewManagerCommandCompat.d.ts +1 -17
- package/lib/typescript/dispatchViewManagerCommandCompat.d.ts.map +1 -1
- package/lib/typescript/gridCdnAuth.d.ts +16 -21
- package/lib/typescript/gridCdnAuth.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/nexrad/nexradAndroidController.d.ts +39 -89
- package/lib/typescript/nexrad/nexradAndroidController.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts +2 -1
- package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradDiag.d.ts +13 -101
- package/lib/typescript/nexrad/nexradDiag.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradLevel2Keys.d.ts +36 -0
- package/lib/typescript/nexrad/nexradLevel2Keys.d.ts.map +1 -0
- package/lib/typescript/nexrad/nexradLutBuild.d.ts +3 -10
- package/lib/typescript/nexrad/nexradLutBuild.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts +4 -3
- package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradSdkImports.d.ts +2 -0
- package/lib/typescript/nexrad/nexradSdkImports.d.ts.map +1 -0
- package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts +12 -7
- package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts +20 -20
- package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts.map +1 -1
- package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts +4 -3
- package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts.map +1 -1
- package/lib/typescript/nexradNativeCommandIds.d.ts +2 -0
- package/lib/typescript/nexradNativeCommandIds.d.ts.map +1 -0
- package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts +6 -17
- package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts.map +1 -1
- package/lib/typescript/nws/eventSourceRnPolyfill.d.ts +0 -3
- package/lib/typescript/nws/eventSourceRnPolyfill.d.ts.map +1 -1
- package/lib/typescript/nws/nwsAndroidConstants.d.ts +0 -5
- package/lib/typescript/nws/nwsAndroidConstants.d.ts.map +1 -1
- package/lib/typescript/satellite/satelliteAndroidController.d.ts +9 -47
- package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
- package/lib/typescript/satelliteBridgeDiag.d.ts +1 -5
- package/lib/typescript/satelliteBridgeDiag.d.ts.map +1 -1
- package/lib/typescript/satelliteRnDebug.d.ts +24 -30
- package/lib/typescript/satelliteRnDebug.d.ts.map +1 -1
- package/package.json +75 -74
- package/src/AguaceroContext.js +1 -7
- package/src/GridRenderLayer.js +1 -128
- package/src/MapManager.js +1 -277
- package/src/MapRegistry.js +1 -56
- package/src/NexradRadarLayer.android.js +1 -121
- package/src/NexradRadarLayer.ios.js +1 -115
- package/src/NexradSitesMapLayer.js +1 -75
- package/src/SatelliteLayer.android.js +1 -63
- package/src/SatelliteLayer.ios.js +1 -70
- package/src/StyleApplicator.js +1 -241
- package/src/WeatherLayerManager.js +1 -2045
- package/src/aguaceroCoreDebugHooks.js +1 -142
- package/src/aguaceroRnDebug.js +1 -336
- package/src/cdnAuthenticatedFetch.js +1 -0
- package/src/dispatchViewManagerCommandCompat.js +1 -100
- package/src/gridCdnAuth.js +1 -56
- package/src/index.js +1 -27
- package/src/nexrad/nexradAndroidController.js +1 -1078
- package/src/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +1 -91
- package/src/nexrad/nexradDiag.js +1 -150
- package/src/nexrad/nexradLevel2Keys.js +1 -0
- package/src/nexrad/nexradLutBuild.js +1 -126
- package/src/nexrad/nexradMapboxFrameOpts.bundled.js +1 -245
- package/src/nexrad/nexradSdkImports.js +1 -0
- package/src/nexrad/radarArchiveCore.bundled.js +1 -7085
- package/src/nexrad/radarDecode.worker.bundled.js +1 -813
- package/src/nexrad/radarFrameGpuMatch.bundled.js +1 -79
- package/src/nexradNativeCommandIds.js +1 -0
- package/src/nws/NwsAlertsOverlay.android.js +1 -1
- package/src/nws/NwsAlertsOverlay.ios.js +1 -1
- package/src/nws/NwsAlertsOverlay.js +1 -7
- package/src/nws/NwsAlertsOverlay.native.js +1 -463
- package/src/nws/eventSourceRnPolyfill.js +7 -193
- package/src/nws/nwsAndroidConstants.js +1 -8
- package/src/satellite/satelliteAndroidController.js +1 -257
- package/src/satelliteBridgeDiag.js +1 -15
- package/src/satelliteRnDebug.js +1 -269
- package/lib/commonjs/nexrad/nexradNativeCommandIds.js +0 -51
- package/lib/commonjs/nexrad/nexradNativeCommandIds.js.map +0 -1
- package/lib/module/nexrad/nexradNativeCommandIds.js +0 -44
- package/lib/module/nexrad/nexradNativeCommandIds.js.map +0 -1
- package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts +0 -9
- package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts.map +0 -1
- package/src/nexrad/nexradNativeCommandIds.js +0 -44
- /package/lib/commonjs/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
- /package/lib/module/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
- /package/src/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
|
@@ -1,101 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (commandId == null) return;
|
|
22
|
-
const handle = findNodeHandle(nativeRef.current);
|
|
23
|
-
UIManager.dispatchViewManagerCommand(handle, commandId, [corners, gridDef]);
|
|
1
|
+
import f, { useRef as g, useImperativeHandle as h, forwardRef as C } from "react";
|
|
2
|
+
import { UIManager as a, findNodeHandle as u, StyleSheet as p } from "react-native";
|
|
3
|
+
import N from "./GridRenderLayerNativeComponent";
|
|
4
|
+
const w = "GridRenderLayer";
|
|
5
|
+
export const GridRenderLayer = /*#__PURE__*/C((l, b) => {
|
|
6
|
+
const r = g(null),
|
|
7
|
+
n = e => {
|
|
8
|
+
try {
|
|
9
|
+
return a.getViewManagerConfig(w)?.Commands?.[e] ?? null;
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return h(b, () => ({
|
|
15
|
+
updateGeometry: (e, t) => {
|
|
16
|
+
if (!r.current) return;
|
|
17
|
+
const c = n("updateGeometry");
|
|
18
|
+
if (c == null) return;
|
|
19
|
+
const o = u(r.current);
|
|
20
|
+
a.dispatchViewManagerCommand(o, c, [e, t]);
|
|
24
21
|
},
|
|
25
|
-
setVariable:
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [variableName]);
|
|
22
|
+
setVariable: e => {
|
|
23
|
+
if (!r.current) return;
|
|
24
|
+
const t = n("setVariable");
|
|
25
|
+
t != null && a.dispatchViewManagerCommand(u(r.current), t, [e]);
|
|
30
26
|
},
|
|
31
|
-
updateDataTextureFromFile: (
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [filePath, Number(nx), Number(ny), Number(scale), Number(offset), Number(missing), scaleType || 'linear']);
|
|
27
|
+
updateDataTextureFromFile: (e, t, c, o, m, s, d) => {
|
|
28
|
+
if (!r.current) return;
|
|
29
|
+
const i = n("updateDataTexture");
|
|
30
|
+
i != null && a.dispatchViewManagerCommand(u(r.current), i, [e, Number(t), Number(c), Number(o), Number(m), Number(s), d || "linear"]);
|
|
36
31
|
},
|
|
37
|
-
updateDataTexture: (
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [base64Data, Number(nx), Number(ny), Number(scale), Number(offset), Number(missing), scaleType || 'linear']);
|
|
32
|
+
updateDataTexture: (e, t, c, o, m, s, d) => {
|
|
33
|
+
if (!r.current) return;
|
|
34
|
+
const i = n("updateDataTexture");
|
|
35
|
+
i != null && a.dispatchViewManagerCommand(u(r.current), i, [e, Number(t), Number(c), Number(o), Number(m), Number(s), d || "linear"]);
|
|
42
36
|
},
|
|
43
|
-
updateColormapTexture:
|
|
44
|
-
if (!
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [colormapArray]);
|
|
37
|
+
updateColormapTexture: e => {
|
|
38
|
+
if (!r.current) return;
|
|
39
|
+
const t = n("updateColormapTexture");
|
|
40
|
+
t != null && a.dispatchViewManagerCommand(u(r.current), t, [e]);
|
|
48
41
|
},
|
|
49
|
-
updateDataParameters: (
|
|
50
|
-
if (!
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [Number(scale), Number(offset), Number(missing), Number(scaleType)]);
|
|
42
|
+
updateDataParameters: (e, t, c, o) => {
|
|
43
|
+
if (!r.current) return;
|
|
44
|
+
const m = n("updateDataParameters");
|
|
45
|
+
m != null && a.dispatchViewManagerCommand(u(r.current), m, [Number(e), Number(t), Number(c), Number(o)]);
|
|
54
46
|
},
|
|
55
|
-
setSmoothing:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
smoothing: enabled
|
|
47
|
+
setSmoothing: e => {
|
|
48
|
+
r.current && r.current.setNativeProps({
|
|
49
|
+
smoothing: e
|
|
59
50
|
});
|
|
60
51
|
},
|
|
61
52
|
clear: () => {
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, []);
|
|
53
|
+
if (!r.current) return;
|
|
54
|
+
const e = n("clear");
|
|
55
|
+
e != null && a.dispatchViewManagerCommand(u(r.current), e, []);
|
|
66
56
|
},
|
|
67
|
-
primeGpuCache:
|
|
68
|
-
if (!
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [frameInfo]);
|
|
57
|
+
primeGpuCache: e => {
|
|
58
|
+
if (!r.current) return;
|
|
59
|
+
const t = n("primeGpuCache");
|
|
60
|
+
t != null && a.dispatchViewManagerCommand(u(r.current), t, [e]);
|
|
72
61
|
},
|
|
73
|
-
setActiveFrame:
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [cacheKey]);
|
|
62
|
+
setActiveFrame: e => {
|
|
63
|
+
if (!r.current) return;
|
|
64
|
+
const t = n("setActiveFrame");
|
|
65
|
+
t != null && a.dispatchViewManagerCommand(u(r.current), t, [e]);
|
|
78
66
|
},
|
|
79
67
|
clearGpuCache: () => {
|
|
80
|
-
if (!
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, []);
|
|
68
|
+
if (!r.current) return;
|
|
69
|
+
const e = n("clearGpuCache");
|
|
70
|
+
e != null && a.dispatchViewManagerCommand(u(r.current), e, []);
|
|
84
71
|
}
|
|
85
|
-
}))
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
style: styles.overlay,
|
|
72
|
+
})), /*#__PURE__*/f.createElement(N, {
|
|
73
|
+
ref: r,
|
|
74
|
+
opacity: l.opacity,
|
|
75
|
+
dataRange: l.dataRange,
|
|
76
|
+
belowID: l.belowID,
|
|
77
|
+
smoothing: !0,
|
|
78
|
+
style: V.overlay,
|
|
93
79
|
pointerEvents: "none"
|
|
94
80
|
});
|
|
95
81
|
});
|
|
96
|
-
const
|
|
82
|
+
const V = p.create({
|
|
97
83
|
overlay: {
|
|
98
|
-
...
|
|
84
|
+
...p.absoluteFillObject
|
|
99
85
|
}
|
|
100
86
|
});
|
|
101
87
|
//# sourceMappingURL=GridRenderLayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["f","useRef","g","useImperativeHandle","h","forwardRef","C","UIManager","a","findNodeHandle","u","StyleSheet","p","N","w","GridRenderLayer","l","b","r","n","e","getViewManagerConfig","Commands","updateGeometry","t","current","c","o","dispatchViewManagerCommand","setVariable","updateDataTextureFromFile","m","s","d","i","Number","updateDataTexture","updateColormapTexture","updateDataParameters","setSmoothing","setNativeProps","smoothing","clear","primeGpuCache","setActiveFrame","clearGpuCache","createElement","ref","opacity","dataRange","belowID","style","V","overlay","pointerEvents","create","absoluteFillObject"],"sourceRoot":"..\\..\\src","sources":["GridRenderLayer.js"],"mappings":"AAAA,OAAOA,CAAC,IAAEC,MAAM,IAAIC,CAAC,EAACC,mBAAmB,IAAIC,CAAC,EAACC,UA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C,IAAG,CAACF,CAAC,CAACO,OAAO,EAAC;MAAO,MAAMD,CAAC,GAACL,CAAC,CAAC,gBAAgB,CAAC;MAACK,CAAC,IAAE,IAAI,IAAEhB,CAAC,CAACoB,0BAA0B,CAAClB,CAAC,CAACQ,CAAC,CAACO,OAAO,CAAC,EAACD,CAAC,EAAC,CAACJ,CAAC,CAAC,CAAC;IAAA,CAAC;IAACyB,aAAa,EAACA,CAAA,KAAI;MAAC,IAAG,CAAC3B,CAAC,CAACO,OAAO,EAAC;MAAO,MAAML,CAAC,GAACD,CAAC,CAAC,eAAe,CAAC;MAACC,CAAC,IAAE,IAAI,IAAEZ,CAAC,CAACoB,0BAA0B,CAAClB,CAAC,CAACQ,CAAC,CAACO,OAAO,CAAC,EAACL,CAAC,EAAC,EAAE,CAAC;IAAA;EAAC,CAAC,CAAC,CAAC,eAACpB,CAAC,CAAC8C,aAAa,CAACjC,CAAC,EAAC;IAACkC,GAAG,EAAC7B,CAAC;IAAC8B,OAAO,EAAChC,CAAC,CAACgC,OAAO;IAACC,SAAS,EAACjC,CAAC,CAACiC,SAAS;IAACC,OAAO,EAAClC,CAAC,CAACkC,OAAO;IAACT,SAAS,EAAC,CAAC,CAAC;IAACU,KAAK,EAACC,CAAC,CAACC,OAAO;IAACC,aAAa,EAAC;EAAM,CAAC,CAAC;AAAA,CAAC,CAAC;AAAC,MAAMF,CAAC,GAACxC,CAAC,CAAC2C,MAAM,CAAC;EAACF,OAAO,EAAC;IAAC,GAAGzC,CAAC,CAAC4C;EAAkB;AAAC,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/MapManager.js
CHANGED
|
@@ -1,267 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// --- UTILITIES ---
|
|
13
|
-
function isObject(item) {
|
|
14
|
-
return item && typeof item === 'object' && !Array.isArray(item);
|
|
1
|
+
import l, { useMemo as E, useEffect as g, useState as V, useRef as R, forwardRef as z, useImperativeHandle as Z } from "react";
|
|
2
|
+
import { View as U, StyleSheet as f, Text as M } from "react-native";
|
|
3
|
+
import y from "@rnmapbox/maps";
|
|
4
|
+
import { THEME_CONFIGS as k } from "@aguacerowx/javascript-sdk";
|
|
5
|
+
import { StyleApplicator as q } from "./StyleApplicator";
|
|
6
|
+
import { AguaceroContext as N } from "./AguaceroContext";
|
|
7
|
+
import { mapRegistry as d } from "./MapRegistry";
|
|
8
|
+
const O = "mapbox://styles/aguacerowx/cmfvox8mq004u01qm5nlg7qkt";
|
|
9
|
+
function b(o) {
|
|
10
|
+
return o && typeof o == "object" && !Array.isArray(o);
|
|
15
11
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
...
|
|
12
|
+
function C(o, a) {
|
|
13
|
+
const c = {
|
|
14
|
+
...o
|
|
19
15
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[key]: source[key]
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
output[key] = deepMerge(target[key], source[key]);
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
Object.assign(output, {
|
|
32
|
-
[key]: source[key]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
16
|
+
return b(o) && b(a) && Object.keys(a).forEach(t => {
|
|
17
|
+
b(a[t]) ? t in o ? c[t] = C(o[t], a[t]) : Object.assign(c, {
|
|
18
|
+
[t]: a[t]
|
|
19
|
+
}) : Object.assign(c, {
|
|
20
|
+
[t]: a[t]
|
|
35
21
|
});
|
|
36
|
-
}
|
|
37
|
-
return output;
|
|
22
|
+
}), c;
|
|
38
23
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
let resolved = BASE_STYLE_URL;
|
|
72
|
-
if (mo.style !== undefined) {
|
|
73
|
-
resolved = mo.style;
|
|
74
|
-
} else if (mo.styleURL !== undefined) {
|
|
75
|
-
resolved = mo.styleURL;
|
|
76
|
-
} else if (mo.styleUrl !== undefined) {
|
|
77
|
-
resolved = mo.styleUrl;
|
|
78
|
-
}
|
|
79
|
-
let anchor = null;
|
|
80
|
-
const customStyleUrl = styleURLProp || styleUrlProp;
|
|
81
|
-
const customBeforeId = belowIDProp || weatherBeforeLayerIdProp;
|
|
82
|
-
if (customStyleUrl) {
|
|
83
|
-
if (customBeforeId && String(customBeforeId).trim()) {
|
|
84
|
-
resolved = customStyleUrl;
|
|
85
|
-
anchor = String(customBeforeId).trim();
|
|
86
|
-
} else if (mo.style === undefined && mo.styleURL === undefined && mo.styleUrl === undefined) {
|
|
87
|
-
resolved = BASE_STYLE_URL;
|
|
88
|
-
}
|
|
89
|
-
} else if (customBeforeId && String(customBeforeId).trim()) {
|
|
90
|
-
anchor = String(customBeforeId).trim();
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
resolvedStyleURL: resolved,
|
|
94
|
-
weatherBeforeLayerId: anchor
|
|
95
|
-
};
|
|
96
|
-
}, [mapOptions, styleURLProp, styleUrlProp, belowIDProp, weatherBeforeLayerIdProp]);
|
|
97
|
-
|
|
98
|
-
// Expose camera and map methods via ref
|
|
99
|
-
useImperativeHandle(ref, () => ({
|
|
100
|
-
// Camera methods
|
|
101
|
-
flyTo: config => {
|
|
102
|
-
if (cameraRef.current) {
|
|
103
|
-
cameraRef.current.flyTo(config);
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
moveTo: config => {
|
|
107
|
-
if (cameraRef.current) {
|
|
108
|
-
cameraRef.current.moveTo(config);
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
zoomTo: (zoomLevel, duration = 2000) => {
|
|
112
|
-
if (cameraRef.current) {
|
|
113
|
-
cameraRef.current.zoomTo(zoomLevel, duration);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
setCamera: config => {
|
|
117
|
-
if (cameraRef.current) {
|
|
118
|
-
cameraRef.current.setCamera(config);
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
// Map methods
|
|
122
|
-
getCenter: async () => {
|
|
123
|
-
if (mapRef.current) {
|
|
124
|
-
return await mapRef.current.getCenter();
|
|
125
|
-
}
|
|
126
|
-
return null;
|
|
127
|
-
},
|
|
128
|
-
getZoom: async () => {
|
|
129
|
-
if (mapRef.current) {
|
|
130
|
-
return await mapRef.current.getZoom();
|
|
131
|
-
}
|
|
132
|
-
return null;
|
|
24
|
+
export const MapManager = /*#__PURE__*/z(({
|
|
25
|
+
mapboxToken: o,
|
|
26
|
+
customStyles: a,
|
|
27
|
+
theme: c = "light",
|
|
28
|
+
mapOptions: t = {},
|
|
29
|
+
styleURL: S,
|
|
30
|
+
styleUrl: v,
|
|
31
|
+
belowID: h,
|
|
32
|
+
weatherBeforeLayerId: w,
|
|
33
|
+
children: F
|
|
34
|
+
}, I) => {
|
|
35
|
+
const r = R(null),
|
|
36
|
+
s = R(null),
|
|
37
|
+
[x, P] = V(null),
|
|
38
|
+
{
|
|
39
|
+
resolvedStyleURL: p,
|
|
40
|
+
weatherBeforeLayerId: T
|
|
41
|
+
} = E(() => {
|
|
42
|
+
const e = t || {};
|
|
43
|
+
let n = O;
|
|
44
|
+
e.style !== void 0 ? n = e.style : e.styleURL !== void 0 ? n = e.styleURL : e.styleUrl !== void 0 && (n = e.styleUrl);
|
|
45
|
+
let u = null;
|
|
46
|
+
const L = S || v,
|
|
47
|
+
i = h || w;
|
|
48
|
+
return L ? i && String(i).trim() ? (n = L, u = String(i).trim()) : e.style === void 0 && e.styleURL === void 0 && e.styleUrl === void 0 && (n = O) : i && String(i).trim() && (u = String(i).trim()), {
|
|
49
|
+
resolvedStyleURL: n,
|
|
50
|
+
weatherBeforeLayerId: u
|
|
51
|
+
};
|
|
52
|
+
}, [t, S, v, h, w]);
|
|
53
|
+
Z(I, () => ({
|
|
54
|
+
flyTo: e => {
|
|
55
|
+
s.current && s.current.flyTo(e);
|
|
133
56
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return await mapRef.current.getCoordinateFromView(point);
|
|
137
|
-
}
|
|
138
|
-
return null;
|
|
57
|
+
moveTo: e => {
|
|
58
|
+
s.current && s.current.moveTo(e);
|
|
139
59
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return await mapRef.current.getPointInView(coordinate);
|
|
143
|
-
}
|
|
144
|
-
return null;
|
|
60
|
+
zoomTo: (e, n = 2e3) => {
|
|
61
|
+
s.current && s.current.zoomTo(e, n);
|
|
145
62
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return await mapRef.current.queryRenderedFeaturesAtPoint(point, filter, layerIds);
|
|
149
|
-
}
|
|
150
|
-
return null;
|
|
63
|
+
setCamera: e => {
|
|
64
|
+
s.current && s.current.setCamera(e);
|
|
151
65
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
66
|
+
getCenter: async () => r.current ? await r.current.getCenter() : null,
|
|
67
|
+
getZoom: async () => r.current ? await r.current.getZoom() : null,
|
|
68
|
+
getCoordinateFromView: async e => r.current ? await r.current.getCoordinateFromView(e) : null,
|
|
69
|
+
getPointInView: async e => r.current ? await r.current.getPointInView(e) : null,
|
|
70
|
+
queryRenderedFeaturesAtPoint: async (e, n, u) => r.current ? await r.current.queryRenderedFeaturesAtPoint(e, n, u) : null,
|
|
71
|
+
getMapRef: () => r.current,
|
|
72
|
+
getCameraRef: () => s.current
|
|
73
|
+
}), []), g(() => {
|
|
74
|
+
r.current && d.setMap(r.current);
|
|
162
75
|
}, []);
|
|
163
|
-
const
|
|
164
|
-
getMap: () =>
|
|
165
|
-
getCenter: () =>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (mapboxToken) {
|
|
187
|
-
Mapbox.setAccessToken(mapboxToken);
|
|
188
|
-
}
|
|
189
|
-
}, [mapboxToken]);
|
|
190
|
-
if (!mapboxToken) {
|
|
191
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
192
|
-
style: [styles.container, styles.centerContent]
|
|
193
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
194
|
-
style: styles.errorText
|
|
195
|
-
}, "Mapbox Token Missing"), /*#__PURE__*/React.createElement(Text, {
|
|
196
|
-
style: styles.errorSubText
|
|
197
|
-
}, "Please provide the 'mapboxToken' prop."));
|
|
198
|
-
}
|
|
199
|
-
const handleCameraChange = event => {
|
|
200
|
-
if (event?.properties?.center) {
|
|
201
|
-
const center = event.properties.center;
|
|
202
|
-
|
|
203
|
-
// Store the current center in the ref for immediate access
|
|
204
|
-
if (mapRef.current) {
|
|
205
|
-
mapRef.current._currentCenter = center;
|
|
76
|
+
const j = E(() => ({
|
|
77
|
+
getMap: () => r.current,
|
|
78
|
+
getCenter: () => r.current?._currentCenter || [-95.7129, 37.0902],
|
|
79
|
+
weatherBeforeLayerId: T,
|
|
80
|
+
resolvedStyleURL: p
|
|
81
|
+
}), [T, p]);
|
|
82
|
+
if (g(() => {
|
|
83
|
+
let e = JSON.parse(JSON.stringify(k.light)),
|
|
84
|
+
n = JSON.parse(JSON.stringify(k.dark));
|
|
85
|
+
a && (a.light && (e = C(e, a.light)), a.dark && (n = C(n, a.dark))), P(c === "dark" ? n : e);
|
|
86
|
+
}, [a, c]), g(() => {
|
|
87
|
+
o && y.setAccessToken(o);
|
|
88
|
+
}, [o]), !o) return /*#__PURE__*/l.createElement(U, {
|
|
89
|
+
style: [m.container, m.centerContent]
|
|
90
|
+
}, /*#__PURE__*/l.createElement(M, {
|
|
91
|
+
style: m.errorText
|
|
92
|
+
}, "Mapbox Token Missing"), /*#__PURE__*/l.createElement(M, {
|
|
93
|
+
style: m.errorSubText
|
|
94
|
+
}, "Please provide the 'mapboxToken' prop."));
|
|
95
|
+
const A = e => {
|
|
96
|
+
if (e?.properties?.center) {
|
|
97
|
+
const n = e.properties.center;
|
|
98
|
+
r.current && (r.current._currentCenter = n), d.notifyCameraChange(n);
|
|
206
99
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}, /*#__PURE__*/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}, /*#__PURE__*/React.createElement(Mapbox.Camera, {
|
|
225
|
-
ref: cameraRef,
|
|
100
|
+
},
|
|
101
|
+
B = e => {
|
|
102
|
+
d.notifyMapPress(e);
|
|
103
|
+
};
|
|
104
|
+
return /*#__PURE__*/l.createElement(U, {
|
|
105
|
+
style: m.container
|
|
106
|
+
}, /*#__PURE__*/l.createElement(N.Provider, {
|
|
107
|
+
value: j
|
|
108
|
+
}, /*#__PURE__*/l.createElement(y.MapView, {
|
|
109
|
+
ref: r,
|
|
110
|
+
style: m.map,
|
|
111
|
+
styleURL: p,
|
|
112
|
+
scaleBarEnabled: !1,
|
|
113
|
+
onCameraChanged: A,
|
|
114
|
+
onPress: B
|
|
115
|
+
}, /*#__PURE__*/l.createElement(y.Camera, {
|
|
116
|
+
ref: s,
|
|
226
117
|
defaultSettings: {
|
|
227
|
-
centerCoordinate:
|
|
228
|
-
zoomLevel:
|
|
229
|
-
pitch:
|
|
230
|
-
bearing:
|
|
231
|
-
minZoomLevel:
|
|
232
|
-
maxZoomLevel:
|
|
118
|
+
centerCoordinate: t.center || [-15.7129, 37.0902],
|
|
119
|
+
zoomLevel: t.zoom || 0,
|
|
120
|
+
pitch: t.pitch || 0,
|
|
121
|
+
bearing: t.bearing || 0,
|
|
122
|
+
minZoomLevel: t.minZoom || 2,
|
|
123
|
+
maxZoomLevel: t.maxZoom || 12
|
|
233
124
|
}
|
|
234
|
-
}),
|
|
235
|
-
styles:
|
|
236
|
-
}), /*#__PURE__*/
|
|
125
|
+
}), x && /*#__PURE__*/l.createElement(q, {
|
|
126
|
+
styles: x
|
|
127
|
+
}), /*#__PURE__*/l.createElement(y.VectorSource, {
|
|
237
128
|
id: "mapbox-dem",
|
|
238
129
|
url: "mapbox://mapbox.mapbox-terrain-dem-v1"
|
|
239
|
-
}),
|
|
130
|
+
}), F)));
|
|
240
131
|
});
|
|
241
|
-
const
|
|
242
|
-
/**
|
|
243
|
-
* Full-bleed positioning so RNMapbox/Mapbox gets non-zero bounds on the first layout pass.
|
|
244
|
-
* A plain flex:1 sibling tree (e.g. map + absolute overlays under Expo Tabs) can still yield
|
|
245
|
-
* a transient 0×0 MapView, which triggers maps-core "Invalid size … fall back to {64, 64}".
|
|
246
|
-
*/
|
|
132
|
+
const m = f.create({
|
|
247
133
|
container: {
|
|
248
|
-
...
|
|
249
|
-
backgroundColor:
|
|
134
|
+
...f.absoluteFillObject,
|
|
135
|
+
backgroundColor: "#1a1a2e"
|
|
250
136
|
},
|
|
251
137
|
centerContent: {
|
|
252
|
-
justifyContent:
|
|
253
|
-
alignItems:
|
|
138
|
+
justifyContent: "center",
|
|
139
|
+
alignItems: "center"
|
|
254
140
|
},
|
|
255
141
|
map: {
|
|
256
|
-
...
|
|
142
|
+
...f.absoluteFillObject
|
|
257
143
|
},
|
|
258
144
|
errorText: {
|
|
259
|
-
color:
|
|
145
|
+
color: "#FF6B6B",
|
|
260
146
|
fontSize: 22,
|
|
261
|
-
fontWeight:
|
|
147
|
+
fontWeight: "bold"
|
|
262
148
|
},
|
|
263
149
|
errorSubText: {
|
|
264
|
-
color:
|
|
150
|
+
color: "white",
|
|
265
151
|
fontSize: 16,
|
|
266
152
|
marginTop: 8
|
|
267
153
|
}
|