react-native-mapsforge-vtm-ext-grib 0.2.0

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.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -0
  3. package/android/CMakeLists.txt +13 -0
  4. package/android/build.gradle +108 -0
  5. package/android/generated/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/NativeWeatherOverlaySpec.java +95 -0
  6. package/android/generated/jni/CMakeLists.txt +28 -0
  7. package/android/generated/jni/RNMapsforgeVtmExtGribSpec-generated.cpp +62 -0
  8. package/android/generated/jni/RNMapsforgeVtmExtGribSpec.h +31 -0
  9. package/android/generated/jni/react/renderer/components/RNMapsforgeVtmExtGribSpec/RNMapsforgeVtmExtGribSpecJSI.h +521 -0
  10. package/android/gradle.properties +5 -0
  11. package/android/src/main/AndroidManifest.xml +2 -0
  12. package/android/src/main/AndroidManifestNew.xml +2 -0
  13. package/android/src/main/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/ExtGribPackage.java +62 -0
  14. package/android/src/main/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/modules/WeatherOverlay.java +343 -0
  15. package/android/src/main/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/tiles/ColorRamp.java +165 -0
  16. package/android/src/main/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/tiles/WeatherGridData.java +103 -0
  17. package/android/src/main/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/tiles/WeatherTileDataSource.java +147 -0
  18. package/android/src/main/java/com/jhotadhari/reactnative/mapsforge/vtm/ext/grib/tiles/WeatherTileSource.java +80 -0
  19. package/lib/commonjs/NativeModules/NativeWeatherOverlay.js +9 -0
  20. package/lib/commonjs/NativeModules/NativeWeatherOverlay.js.map +1 -0
  21. package/lib/commonjs/components/WeatherOverlay.js +180 -0
  22. package/lib/commonjs/components/WeatherOverlay.js.map +1 -0
  23. package/lib/commonjs/index.js +21 -0
  24. package/lib/commonjs/index.js.map +1 -0
  25. package/lib/commonjs/package.json +1 -0
  26. package/lib/commonjs/reanimated/index.js +13 -0
  27. package/lib/commonjs/reanimated/index.js.map +1 -0
  28. package/lib/commonjs/reanimated/useWeatherAnimation.js +86 -0
  29. package/lib/commonjs/reanimated/useWeatherAnimation.js.map +1 -0
  30. package/lib/commonjs/reportNativeError.js +14 -0
  31. package/lib/commonjs/reportNativeError.js.map +1 -0
  32. package/lib/commonjs/types.js +2 -0
  33. package/lib/commonjs/types.js.map +1 -0
  34. package/lib/module/NativeModules/NativeWeatherOverlay.js +5 -0
  35. package/lib/module/NativeModules/NativeWeatherOverlay.js.map +1 -0
  36. package/lib/module/components/WeatherOverlay.js +174 -0
  37. package/lib/module/components/WeatherOverlay.js.map +1 -0
  38. package/lib/module/index.js +16 -0
  39. package/lib/module/index.js.map +1 -0
  40. package/lib/module/package.json +1 -0
  41. package/lib/module/reanimated/index.js +4 -0
  42. package/lib/module/reanimated/index.js.map +1 -0
  43. package/lib/module/reanimated/useWeatherAnimation.js +81 -0
  44. package/lib/module/reanimated/useWeatherAnimation.js.map +1 -0
  45. package/lib/module/reportNativeError.js +10 -0
  46. package/lib/module/reportNativeError.js.map +1 -0
  47. package/lib/module/types.js +2 -0
  48. package/lib/module/types.js.map +1 -0
  49. package/lib/typescript/commonjs/package.json +1 -0
  50. package/lib/typescript/commonjs/src/NativeModules/NativeWeatherOverlay.d.ts +63 -0
  51. package/lib/typescript/commonjs/src/NativeModules/NativeWeatherOverlay.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/src/components/WeatherOverlay.d.ts +10 -0
  53. package/lib/typescript/commonjs/src/components/WeatherOverlay.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/src/index.d.ts +11 -0
  55. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/reanimated/index.d.ts +3 -0
  57. package/lib/typescript/commonjs/src/reanimated/index.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/reanimated/useWeatherAnimation.d.ts +44 -0
  59. package/lib/typescript/commonjs/src/reanimated/useWeatherAnimation.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/reportNativeError.d.ts +3 -0
  61. package/lib/typescript/commonjs/src/reportNativeError.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/types.d.ts +51 -0
  63. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  64. package/lib/typescript/module/package.json +1 -0
  65. package/lib/typescript/module/src/NativeModules/NativeWeatherOverlay.d.ts +63 -0
  66. package/lib/typescript/module/src/NativeModules/NativeWeatherOverlay.d.ts.map +1 -0
  67. package/lib/typescript/module/src/components/WeatherOverlay.d.ts +10 -0
  68. package/lib/typescript/module/src/components/WeatherOverlay.d.ts.map +1 -0
  69. package/lib/typescript/module/src/index.d.ts +11 -0
  70. package/lib/typescript/module/src/index.d.ts.map +1 -0
  71. package/lib/typescript/module/src/reanimated/index.d.ts +3 -0
  72. package/lib/typescript/module/src/reanimated/index.d.ts.map +1 -0
  73. package/lib/typescript/module/src/reanimated/useWeatherAnimation.d.ts +44 -0
  74. package/lib/typescript/module/src/reanimated/useWeatherAnimation.d.ts.map +1 -0
  75. package/lib/typescript/module/src/reportNativeError.d.ts +3 -0
  76. package/lib/typescript/module/src/reportNativeError.d.ts.map +1 -0
  77. package/lib/typescript/module/src/types.d.ts +51 -0
  78. package/lib/typescript/module/src/types.d.ts.map +1 -0
  79. package/package.json +159 -0
  80. package/react-native.config.js +13 -0
  81. package/src/NativeModules/NativeWeatherOverlay.ts +73 -0
  82. package/src/components/WeatherOverlay.tsx +173 -0
  83. package/src/index.ts +22 -0
  84. package/src/reanimated/index.ts +2 -0
  85. package/src/reanimated/useWeatherAnimation.ts +118 -0
  86. package/src/reportNativeError.ts +15 -0
  87. package/src/types.ts +56 -0
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import { useContext, useEffect } from 'react';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import WeatherOverlayModule from "../NativeModules/NativeWeatherOverlay.js";
12
+ import reportNativeError from "../reportNativeError.js";
13
+
14
+ /**
15
+ * Peer dependencies (from react-native-mapsforge-vtm)
16
+ */
17
+ import { MapHandleContext, useLayerAnchor, useSceneUuidBinding, useNativeLayerLifecycle } from 'react-native-mapsforge-vtm';
18
+ const WeatherOverlay = ({
19
+ dataUrl,
20
+ parameter,
21
+ timeIndex,
22
+ colorMap,
23
+ opacity,
24
+ zoomMin,
25
+ zoomMax,
26
+ enabledZoomMin,
27
+ enabledZoomMax,
28
+ onCreate,
29
+ onRemove,
30
+ onChange,
31
+ onError
32
+ }) => {
33
+ const {
34
+ nativeNodeHandle
35
+ } = useContext(MapHandleContext);
36
+ const {
37
+ uid: anchorUid,
38
+ element: anchorElement
39
+ } = useLayerAnchor({
40
+ kind: 'layer'
41
+ });
42
+ const {
43
+ uuid,
44
+ triggerCreate,
45
+ triggerRemove
46
+ } = useNativeLayerLifecycle({
47
+ enabled: !!nativeNodeHandle && !!dataUrl,
48
+ create: ({
49
+ triggerOnCreate,
50
+ triggerOnChange
51
+ }) => {
52
+ if (!nativeNodeHandle) {
53
+ return Promise.reject({
54
+ userInfo: {
55
+ errorMsg: 'Missing nativeNodeHandle'
56
+ }
57
+ });
58
+ }
59
+ return WeatherOverlayModule.createLayer({
60
+ nativeNodeHandle,
61
+ ...(dataUrl && {
62
+ dataUrl
63
+ }),
64
+ ...(parameter && {
65
+ parameter
66
+ }),
67
+ ...(timeIndex != null && {
68
+ timeIndex: Math.round(timeIndex)
69
+ }),
70
+ ...(colorMap && {
71
+ colorMap
72
+ }),
73
+ ...(opacity != null && {
74
+ opacity
75
+ }),
76
+ ...(zoomMin != null && {
77
+ zoomMin: Math.round(zoomMin)
78
+ }),
79
+ ...(zoomMax != null && {
80
+ zoomMax: Math.round(zoomMax)
81
+ }),
82
+ ...(enabledZoomMin != null && {
83
+ enabledZoomMin: Math.round(enabledZoomMin)
84
+ }),
85
+ ...(enabledZoomMax != null && {
86
+ enabledZoomMax: Math.round(enabledZoomMax)
87
+ })
88
+ }).then(newUuid => {
89
+ triggerOnCreate && onCreate ? onCreate({
90
+ nativeNodeHandle,
91
+ uuid: newUuid
92
+ }) : null;
93
+ triggerOnChange && onChange ? onChange({
94
+ nativeNodeHandle,
95
+ uuid: newUuid
96
+ }) : null;
97
+ return newUuid;
98
+ });
99
+ },
100
+ remove: (currentUuid, {
101
+ triggerOnRemove
102
+ }) => {
103
+ if (!nativeNodeHandle) {
104
+ return Promise.resolve(false);
105
+ }
106
+ return WeatherOverlayModule.removeLayer({
107
+ nativeNodeHandle,
108
+ uuid: currentUuid
109
+ }).then(removedUuid => {
110
+ triggerOnRemove && onRemove ? onRemove({
111
+ nativeNodeHandle,
112
+ uuid: removedUuid
113
+ }) : null;
114
+ return true;
115
+ }).catch(err => {
116
+ reportNativeError(err, onError);
117
+ return false;
118
+ });
119
+ },
120
+ onError
121
+ });
122
+ useSceneUuidBinding(anchorUid, uuid);
123
+
124
+ // Update enabledZoomMin/enabledZoomMax in place.
125
+ useEffect(() => {
126
+ if (nativeNodeHandle && uuid) {
127
+ WeatherOverlayModule.updateEnabledZoomMinMax({
128
+ nativeNodeHandle,
129
+ uuid,
130
+ ...(enabledZoomMin != null && {
131
+ enabledZoomMin: Math.round(enabledZoomMin)
132
+ }),
133
+ ...(enabledZoomMax != null && {
134
+ enabledZoomMax: Math.round(enabledZoomMax)
135
+ })
136
+ }).catch(err => {
137
+ reportNativeError(err, onError);
138
+ });
139
+ }
140
+ }, [enabledZoomMin, enabledZoomMax, nativeNodeHandle, uuid, onError]);
141
+
142
+ // Update opacity in place.
143
+ useEffect(() => {
144
+ if (nativeNodeHandle && uuid && opacity != null) {
145
+ WeatherOverlayModule.setOpacity({
146
+ nativeNodeHandle,
147
+ uuid,
148
+ opacity
149
+ }).catch(err => {
150
+ reportNativeError(err, onError);
151
+ });
152
+ }
153
+ }, [opacity, nativeNodeHandle, uuid, onError]);
154
+
155
+ // Recreate on these prop changes (baked into native construction).
156
+ // timeIndex is included here because changing it requires a fresh data
157
+ // fetch and tile source — same as dataUrl or parameter changes.
158
+ useEffect(() => {
159
+ triggerRemove({
160
+ triggerOnRemove: false
161
+ }).then(success => {
162
+ if (success) {
163
+ triggerCreate({
164
+ triggerOnCreate: false,
165
+ triggerOnChange: true
166
+ });
167
+ }
168
+ });
169
+ }, [dataUrl, parameter, timeIndex, colorMap, zoomMin, zoomMax, triggerRemove, triggerCreate]);
170
+ return anchorElement;
171
+ };
172
+ WeatherOverlay.defaults = WeatherOverlayModule.getConstants();
173
+ export default WeatherOverlay;
174
+ //# sourceMappingURL=WeatherOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useContext","useEffect","WeatherOverlayModule","reportNativeError","MapHandleContext","useLayerAnchor","useSceneUuidBinding","useNativeLayerLifecycle","WeatherOverlay","dataUrl","parameter","timeIndex","colorMap","opacity","zoomMin","zoomMax","enabledZoomMin","enabledZoomMax","onCreate","onRemove","onChange","onError","nativeNodeHandle","uid","anchorUid","element","anchorElement","kind","uuid","triggerCreate","triggerRemove","enabled","create","triggerOnCreate","triggerOnChange","Promise","reject","userInfo","errorMsg","createLayer","Math","round","then","newUuid","remove","currentUuid","triggerOnRemove","resolve","removeLayer","removedUuid","catch","err","updateEnabledZoomMinMax","setOpacity","success","defaults","getConstants"],"sourceRoot":"../../../src","sources":["components/WeatherOverlay.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;;AAE7C;AACA;AACA;AACA,OAAOC,oBAAoB,MAEpB,0CAAuC;AAE9C,OAAOC,iBAAiB,MAAM,yBAAsB;;AAEpD;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,cAAc,EACdC,mBAAmB,EACnBC,uBAAuB,QACjB,4BAA4B;AAEnC,MAAMC,cAAc,GAAGA,CAAC;EACvBC,OAAO;EACPC,SAAS;EAC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AC;EACH,CAAC,EAAE,CACFzB,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRE,OAAO,EACPC,OAAO,EACPe,aAAa,EACbD,aAAa,CACb,CAAC;EAEF,OAAOH,aAAa;AACrB,CAAC;AAEDlB,cAAc,CAAC+C,QAAQ,GAAGrD,oBAAoB,CAACsD,YAAY,CAAC,CAAC;AAE7D,eAAehD,cAAc","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * react-native-mapsforge-vtm-ext-grib
5
+ *
6
+ * Weather GRIB overlay extension for react-native-mapsforge-vtm.
7
+ */
8
+
9
+ // Main component
10
+ export { default as WeatherOverlay } from "./components/WeatherOverlay.js";
11
+
12
+ // Shared types
13
+
14
+ // Reanimated utilities (also available via /reanimated subpath export)
15
+ export { useWeatherAnimation } from "./reanimated/useWeatherAnimation.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","WeatherOverlay","useWeatherAnimation"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,cAAc,QAAQ,gCAA6B;;AAGvE;;AASA;AACA,SAASC,mBAAmB,QAAQ,qCAAkC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { useWeatherAnimation } from "./useWeatherAnimation.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useWeatherAnimation"],"sourceRoot":"../../../src","sources":["reanimated/index.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,0BAAuB","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ import { useCallback, useMemo } from 'react';
4
+ import { useSharedValue, withTiming } from 'react-native-reanimated';
5
+ /**
6
+ * Creates a reanimated shared value that drives smooth time-step animation
7
+ * for a weather overlay.
8
+ *
9
+ * The progress value ranges from 0.0 to (numTimeSteps - 1), where the
10
+ * fractional part represents the interpolation between adjacent time steps.
11
+ *
12
+ * Usage with WeatherOverlay:
13
+ * - Pass `Math.floor(progress.value)` as `timeIndex` to the "current" layer
14
+ * - Pass `Math.ceil(progress.value)` as `timeIndex` to the "next" layer
15
+ * - Set the "next" layer's opacity to `progress.value - Math.floor(progress.value)`
16
+ *
17
+ * @param numTimeSteps - Total number of forecast time steps available.
18
+ * @param durationMs - Duration of the full animation in milliseconds.
19
+ * @returns Animation controls including the progress shared value.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * const { progressSv, play, pause } = useWeatherAnimation(
24
+ * weatherData.timeSteps.length,
25
+ * 10000
26
+ * );
27
+ *
28
+ * // In a worklet or useDerivedValue:
29
+ * const currentIdx = Math.floor(progressSv.value);
30
+ * const nextAlpha = progressSv.value - currentIdx;
31
+ * ```
32
+ */
33
+ export function useWeatherAnimation(numTimeSteps, durationMs = 10000) {
34
+ const progressSv = useSharedValue(0);
35
+ const isPlayingSv = useSharedValue(false);
36
+ const play = useCallback(() => {
37
+ 'worklet';
38
+
39
+ if (isPlayingSv.value) return;
40
+ isPlayingSv.value = true;
41
+
42
+ // Calculate remaining duration based on current progress
43
+ const remainingProgress = numTimeSteps - 1 - progressSv.value;
44
+ const remainingDuration = Math.max(100, remainingProgress / (numTimeSteps - 1) * durationMs);
45
+ progressSv.value = withTiming(numTimeSteps - 1, {
46
+ duration: Math.round(remainingDuration)
47
+ }, finished => {
48
+ if (finished) {
49
+ isPlayingSv.value = false;
50
+ }
51
+ });
52
+ }, [numTimeSteps, durationMs, progressSv, isPlayingSv]);
53
+ const pause = useCallback(() => {
54
+ 'worklet';
55
+
56
+ isPlayingSv.value = false;
57
+ // Cancel the current timing by setting to current value
58
+ progressSv.value = progressSv.value;
59
+ }, [progressSv, isPlayingSv]);
60
+ const reset = useCallback(() => {
61
+ 'worklet';
62
+
63
+ isPlayingSv.value = false;
64
+ progressSv.value = 0;
65
+ }, [progressSv, isPlayingSv]);
66
+ const seek = useCallback(timeIndex => {
67
+ 'worklet';
68
+
69
+ const clamped = Math.max(0, Math.min(numTimeSteps - 1, timeIndex));
70
+ progressSv.value = clamped;
71
+ }, [numTimeSteps, progressSv]);
72
+ return useMemo(() => ({
73
+ progressSv,
74
+ play,
75
+ pause,
76
+ reset,
77
+ seek
78
+ }), [progressSv, play, pause, reset, seek]);
79
+ }
80
+ export default useWeatherAnimation;
81
+ //# sourceMappingURL=useWeatherAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useMemo","useSharedValue","withTiming","useWeatherAnimation","numTimeSteps","durationMs","progressSv","isPlayingSv","play","value","remainingProgress","remainingDuration","Math","max","duration","round","finished","pause","reset","seek","timeIndex","clamped","min"],"sourceRoot":"../../../src","sources":["reanimated/useWeatherAnimation.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,SACCC,cAAc,EACdC,UAAU,QAEJ,yBAAyB;AAehC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAClCC,YAAoB,EACpBC,UAAkB,GAAG,KAAK,EACC;EAC3B,MAAMC,UAAU,GAAGL,cAAc,CAAS,CAAC,CAAC;EAC5C,MAAMM,WAAW,GAAGN,cAAc,CAAU,KAAK,CAAC;EAElD,MAAMO,IAAI,GAAGT,WAAW,CAAC,MAAM;IAC9B,SAAS;;IACT,IAAIQ,WAAW,CAACE,KAAK,EAAE;IACvBF,WAAW,CAACE,KAAK,GAAG,IAAI;;IAExB;IACA,MAAMC,iBAAiB,GAAGN,YAAY,GAAG,CAAC,GAAGE,UAAU,CAACG,KAAK;IAC7D,MAAME,iBAAiB,GAAGC,IAAI,CAACC,GAAG,CACjC,GAAG,EAC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,KAAK,EACLC,IAAI,CAEN,CAAC;AACF;AAEA,eAAehB,mBAAmB","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ export default function reportNativeError(err, onError) {
4
+ if (onError) {
5
+ onError(err);
6
+ } else if (__DEV__) {
7
+ console.warn('[react-native-mapsforge-vtm-ext-grib]', err?.userInfo?.errorMsg ?? 'Unknown native error');
8
+ }
9
+ }
10
+ //# sourceMappingURL=reportNativeError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["reportNativeError","err","onError","__DEV__","console","warn","userInfo","errorMsg"],"sourceRoot":"../../src","sources":["reportNativeError.ts"],"mappings":";;AAEA,eAAe,SAASA,iBAAiBA,CACxCC,GAAc,EACdC,OAA2C,EACpC;EACP,IAAIA,OAAO,EAAE;IACZA,OAAO,CAACD,GAAG,CAAC;EACb,CAAC,MAAM,IAAIE,OAAO,EAAE;IACnBC,OAAO,CAACC,IAAI,CACX,uCAAuC,EACvCJ,GAAG,EAAEK,QAAQ,EAAEC,QAAQ,IAAI,sBAC5B,CAAC;EACF;AACD","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,63 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import type { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import type { ErrorBase, ResponseBase } from '../types';
4
+ export interface ModuleParams {
5
+ dataUrl?: string;
6
+ parameter?: string;
7
+ timeIndex?: Int32;
8
+ colorMap?: string;
9
+ opacity?: Double;
10
+ zoomMin?: Int32;
11
+ zoomMax?: Int32;
12
+ enabledZoomMin?: Int32;
13
+ enabledZoomMax?: Int32;
14
+ }
15
+ interface CreateLayerParams extends ModuleParams {
16
+ nativeNodeHandle?: Int32;
17
+ }
18
+ interface RemoveLayerParams {
19
+ nativeNodeHandle: Int32;
20
+ uuid: string;
21
+ }
22
+ interface UpdateEnabledZoomMinMaxParams {
23
+ nativeNodeHandle: Int32;
24
+ uuid: string;
25
+ enabledZoomMin?: Int32;
26
+ enabledZoomMax?: Int32;
27
+ }
28
+ interface SetOpacityParams {
29
+ nativeNodeHandle: Int32;
30
+ uuid: string;
31
+ opacity?: Double;
32
+ }
33
+ interface SetTimeIndexParams {
34
+ nativeNodeHandle: Int32;
35
+ uuid: string;
36
+ timeIndex: Int32;
37
+ }
38
+ export type WeatherOverlayProps = {
39
+ dataUrl?: string;
40
+ parameter?: string;
41
+ timeIndex?: number;
42
+ colorMap?: string;
43
+ opacity?: number;
44
+ zoomMin?: number;
45
+ zoomMax?: number;
46
+ enabledZoomMin?: number;
47
+ enabledZoomMax?: number;
48
+ onCreate?: null | ((result: ResponseBase) => void);
49
+ onRemove?: null | ((result: ResponseBase) => void);
50
+ onChange?: null | ((result: ResponseBase) => void);
51
+ onError?: null | ((err: ErrorBase) => void);
52
+ };
53
+ export interface Spec extends TurboModule {
54
+ getConstants(): ModuleParams;
55
+ createLayer(params: CreateLayerParams): Promise<string>;
56
+ removeLayer(params: RemoveLayerParams): Promise<string>;
57
+ updateEnabledZoomMinMax(params: UpdateEnabledZoomMinMaxParams): Promise<string>;
58
+ setOpacity(params: SetOpacityParams): Promise<string>;
59
+ setTimeIndex(params: SetTimeIndexParams): Promise<string>;
60
+ }
61
+ declare const _default: Spec;
62
+ export default _default;
63
+ //# sourceMappingURL=NativeWeatherOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeWeatherOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/NativeModules/NativeWeatherOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OA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jB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACxC,YAAY,IAAI,YAAY,CAAC;IAC7B,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,uBAAuB,CACtB,MAAM,EAAE,6BAA6B,GACnC,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D;;AAED,wBAAwE"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { type WeatherOverlayProps } from '../NativeModules/NativeWeatherOverlay';
5
+ declare const WeatherOverlay: {
6
+ ({ dataUrl, parameter, timeIndex, colorMap, opacity, zoomMin, zoomMax, enabledZoomMin, enabledZoomMax, onCreate, onRemove, onChange, onError, }: WeatherOverlayProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
7
+ defaults: import("../NativeModules/NativeWeatherOverlay").ModuleParams;
8
+ };
9
+ export default WeatherOverlay;
10
+ //# sourceMappingURL=WeatherOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeatherOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/components/WeatherOverlay.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAA6B,EAC5B,KAAK,mBAAmB,EACxB,MAAM,uCAAuC,CAAC;AAc/C,QAAA,MAAM,cAAc;qJAcjB,mBAAmB;;CAkIrB,CAAC;AAIF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * react-native-mapsforge-vtm-ext-grib
3
+ *
4
+ * Weather GRIB overlay extension for react-native-mapsforge-vtm.
5
+ */
6
+ export { default as WeatherOverlay } from './components/WeatherOverlay';
7
+ export type { WeatherOverlayProps } from './NativeModules/NativeWeatherOverlay';
8
+ export type { WeatherGrid, WeatherMetadata, ColorMapName, ResponseBase, ErrorBase, } from './types';
9
+ export { useWeatherAnimation } from './reanimated/useWeatherAnimation';
10
+ export type { WeatherAnimationControls } from './reanimated/useWeatherAnimation';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAGhF,YAAY,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,GACT,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useWeatherAnimation } from './useWeatherAnimation';
2
+ export type { WeatherAnimationControls } from './useWeatherAnimation';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/reanimated/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { type SharedValue } from 'react-native-reanimated';
2
+ export interface WeatherAnimationControls {
3
+ /** The current animation progress (0.0 to timeSteps.length - 1). */
4
+ progressSv: SharedValue<number>;
5
+ /** Start playing the animation. */
6
+ play: () => void;
7
+ /** Pause the animation. */
8
+ pause: () => void;
9
+ /** Reset to the first time step. */
10
+ reset: () => void;
11
+ /** Seek to a specific time step index (fractional for interpolation). */
12
+ seek: (timeIndex: number) => void;
13
+ }
14
+ /**
15
+ * Creates a reanimated shared value that drives smooth time-step animation
16
+ * for a weather overlay.
17
+ *
18
+ * The progress value ranges from 0.0 to (numTimeSteps - 1), where the
19
+ * fractional part represents the interpolation between adjacent time steps.
20
+ *
21
+ * Usage with WeatherOverlay:
22
+ * - Pass `Math.floor(progress.value)` as `timeIndex` to the "current" layer
23
+ * - Pass `Math.ceil(progress.value)` as `timeIndex` to the "next" layer
24
+ * - Set the "next" layer's opacity to `progress.value - Math.floor(progress.value)`
25
+ *
26
+ * @param numTimeSteps - Total number of forecast time steps available.
27
+ * @param durationMs - Duration of the full animation in milliseconds.
28
+ * @returns Animation controls including the progress shared value.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * const { progressSv, play, pause } = useWeatherAnimation(
33
+ * weatherData.timeSteps.length,
34
+ * 10000
35
+ * );
36
+ *
37
+ * // In a worklet or useDerivedValue:
38
+ * const currentIdx = Math.floor(progressSv.value);
39
+ * const nextAlpha = progressSv.value - currentIdx;
40
+ * ```
41
+ */
42
+ export declare function useWeatherAnimation(numTimeSteps: number, durationMs?: number): WeatherAnimationControls;
43
+ export default useWeatherAnimation;
44
+ //# sourceMappingURL=useWeatherAnimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWeatherAnimation.d.ts","sourceRoot":"","sources":["../../../../../src/reanimated/useWeatherAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,WAAW,EAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACxC,oEAAoE;IACpE,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,mCAAmC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,oCAAoC;IACpC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,yEAAyE;IACzE,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,mBAAmB,CAClC,YAAY,EAAE,MAAM,EACpB,UAAU,GAAE,MAAc,GACxB,wBAAwB,CAgE1B;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ErrorBase } from './types';
2
+ export default function reportNativeError(err: ErrorBase, onError?: null | ((err: ErrorBase) => void)): void;
3
+ //# sourceMappingURL=reportNativeError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportNativeError.d.ts","sourceRoot":"","sources":["../../../../src/reportNativeError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,GAAG,EAAE,SAAS,EACd,OAAO,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC,GACzC,IAAI,CASN"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Base types shared across the ext-grib library.
3
+ *
4
+ * Mirrors the pattern from react-native-mapsforge-vtm's types.ts.
5
+ */
6
+ export interface ResponseBase {
7
+ uuid: string;
8
+ nativeNodeHandle: number;
9
+ }
10
+ export interface ErrorBase {
11
+ userInfo?: {
12
+ errorMsg?: string;
13
+ };
14
+ }
15
+ /**
16
+ * Represents one time step of gridded weather data.
17
+ * This is the format produced by server-side GRIB to JSON conversion
18
+ * (and later by on-device JGribX parsing).
19
+ */
20
+ export interface WeatherGrid {
21
+ /** UTC ISO timestamp e.g. "2026-07-03T00:00:00Z" */
22
+ validTime: string;
23
+ /** Minimum latitude of the grid (southern edge) */
24
+ minLat: number;
25
+ /** Maximum latitude of the grid (northern edge) */
26
+ maxLat: number;
27
+ /** Minimum longitude of the grid (western edge) */
28
+ minLng: number;
29
+ /** Maximum longitude of the grid (eastern edge) */
30
+ maxLng: number;
31
+ /** Number of grid points in the longitude direction */
32
+ ni: number;
33
+ /** Number of grid points in the latitude direction */
34
+ nj: number;
35
+ /** Row-major grid values, length = ni * nj. Missing values are NaN. */
36
+ values: number[];
37
+ }
38
+ /**
39
+ * Metadata for a weather data source (returned after loading).
40
+ */
41
+ export interface WeatherMetadata {
42
+ parameter: string;
43
+ levelType?: string;
44
+ unit: string;
45
+ timeSteps: WeatherGrid[];
46
+ }
47
+ /**
48
+ * Built-in color ramp identifiers.
49
+ */
50
+ export type ColorMapName = 'temperature' | 'wind' | 'pressure' | 'rainfall' | 'waves' | 'grayscale';
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACvB,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,63 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import type { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import type { ErrorBase, ResponseBase } from '../types.js';
4
+ export interface ModuleParams {
5
+ dataUrl?: string;
6
+ parameter?: string;
7
+ timeIndex?: Int32;
8
+ colorMap?: string;
9
+ opacity?: Double;
10
+ zoomMin?: Int32;
11
+ zoomMax?: Int32;
12
+ enabledZoomMin?: Int32;
13
+ enabledZoomMax?: Int32;
14
+ }
15
+ interface CreateLayerParams extends ModuleParams {
16
+ nativeNodeHandle?: Int32;
17
+ }
18
+ interface RemoveLayerParams {
19
+ nativeNodeHandle: Int32;
20
+ uuid: string;
21
+ }
22
+ interface UpdateEnabledZoomMinMaxParams {
23
+ nativeNodeHandle: Int32;
24
+ uuid: string;
25
+ enabledZoomMin?: Int32;
26
+ enabledZoomMax?: Int32;
27
+ }
28
+ interface SetOpacityParams {
29
+ nativeNodeHandle: Int32;
30
+ uuid: string;
31
+ opacity?: Double;
32
+ }
33
+ interface SetTimeIndexParams {
34
+ nativeNodeHandle: Int32;
35
+ uuid: string;
36
+ timeIndex: Int32;
37
+ }
38
+ export type WeatherOverlayProps = {
39
+ dataUrl?: string;
40
+ parameter?: string;
41
+ timeIndex?: number;
42
+ colorMap?: string;
43
+ opacity?: number;
44
+ zoomMin?: number;
45
+ zoomMax?: number;
46
+ enabledZoomMin?: number;
47
+ enabledZoomMax?: number;
48
+ onCreate?: null | ((result: ResponseBase) => void);
49
+ onRemove?: null | ((result: ResponseBase) => void);
50
+ onChange?: null | ((result: ResponseBase) => void);
51
+ onError?: null | ((err: ErrorBase) => void);
52
+ };
53
+ export interface Spec extends TurboModule {
54
+ getConstants(): ModuleParams;
55
+ createLayer(params: CreateLayerParams): Promise<string>;
56
+ removeLayer(params: RemoveLayerParams): Promise<string>;
57
+ updateEnabledZoomMinMax(params: UpdateEnabledZoomMinMaxParams): Promise<string>;
58
+ setOpacity(params: SetOpacityParams): Promise<string>;
59
+ setTimeIndex(params: SetTimeIndexParams): Promise<string>;
60
+ }
61
+ declare const _default: Spec;
62
+ export default _default;
63
+ //# sourceMappingURL=NativeWeatherOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeWeatherOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/NativeModules/NativeWeatherOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC;AAExD,MAAM,WAAW,YAAY;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;I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AAM,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACxC,YAAY,IAAI,YAAY,CAAC;IAC7B,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,uBAAuB,CACtB,MAAM,EAAE,6BAA6B,GACnC,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D;;AAED,wBAAwE"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { type WeatherOverlayProps } from '../NativeModules/NativeWeatherOverlay.js';
5
+ declare const WeatherOverlay: {
6
+ ({ dataUrl, parameter, timeIndex, colorMap, opacity, zoomMin, zoomMax, enabledZoomMin, enabledZoomMax, onCreate, onRemove, onChange, onError, }: WeatherOverlayProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
7
+ defaults: import("../NativeModules/NativeWeatherOverlay.js").ModuleParams;
8
+ };
9
+ export default WeatherOverlay;
10
+ //# sourceMappingURL=WeatherOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeatherOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/components/WeatherOverlay.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAA6B,EAC5B,KAAK,mBAAmB,EACxB,MAAM,0CAAuC,CAAC;AAc/C,QAAA,MAAM,cAAc;qJAcjB,mBAAmB;;CAkIrB,CAAC;AAIF,eAAe,cAAc,CAAC"}