@aguacerowx/react-native 0.0.3 → 0.0.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.
Files changed (386) hide show
  1. package/README.md +51 -6
  2. package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.dex +0 -0
  4. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer.dex +0 -0
  5. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayerView.dex +0 -0
  6. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderManager.dex +0 -0
  7. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/WeatherFrameProcessorModule.dex +0 -0
  8. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  9. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  10. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  11. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
  12. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  13. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  14. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  15. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  16. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  17. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +16 -2
  18. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  19. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  20. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  21. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  22. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  23. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  24. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  25. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  26. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  27. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  28. package/android/build.gradle +1 -1
  29. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +9 -51
  30. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +8 -2
  31. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +15 -14
  32. package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +15 -0
  33. package/android/src/main/res/raw/fragment_shader.glsl +13 -2
  34. package/ios/GridRenderLayer.swift +62 -0
  35. package/ios/GridRenderLayerManager.mm +140 -0
  36. package/ios/aguacerowx-react-native.podspec +29 -0
  37. package/lib/commonjs/README.md +61 -0
  38. package/lib/commonjs/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  39. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  40. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  41. package/lib/commonjs/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  42. package/lib/commonjs/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  43. package/lib/commonjs/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  44. package/lib/commonjs/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  45. package/lib/commonjs/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  46. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  47. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  48. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  49. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  50. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  51. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  52. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  53. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  54. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  55. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  56. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  57. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  58. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  59. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  60. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  61. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  62. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  63. package/lib/commonjs/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  64. package/lib/commonjs/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  65. package/lib/commonjs/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  66. package/lib/commonjs/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  67. package/lib/commonjs/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  68. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  69. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  70. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +101 -0
  71. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  72. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  73. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  74. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  75. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  76. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  77. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  78. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  79. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  80. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  81. package/lib/commonjs/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  82. package/lib/commonjs/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  83. package/lib/commonjs/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  84. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  85. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  86. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  87. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  88. package/lib/commonjs/android/build.gradle +85 -0
  89. package/lib/commonjs/android/src/main/AndroidManifest.xml +7 -0
  90. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +34 -0
  91. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +597 -0
  92. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +293 -0
  93. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +112 -0
  94. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +64 -0
  95. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +107 -0
  96. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +166 -0
  97. package/lib/commonjs/android/src/main/res/raw/debug_fragment_shader.glsl +13 -0
  98. package/lib/commonjs/android/src/main/res/raw/debug_vertex_shader.glsl +13 -0
  99. package/lib/commonjs/android/src/main/res/raw/fragment_shader.glsl +98 -0
  100. package/lib/commonjs/android/src/main/res/raw/vertex_shader.glsl +20 -0
  101. package/lib/commonjs/babel.config.js +7 -0
  102. package/lib/commonjs/babel.config.js.map +1 -0
  103. package/lib/commonjs/index.js +20 -0
  104. package/lib/commonjs/index.js.map +1 -0
  105. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  106. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  107. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  108. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  109. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  110. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  111. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  112. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  113. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  114. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  115. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  116. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  117. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  118. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  119. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  120. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  121. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  122. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  123. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  124. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  125. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  126. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +972 -0
  127. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  128. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +381 -0
  129. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  130. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1229 -0
  131. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  132. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4023 -0
  133. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  134. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +38 -0
  135. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  136. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +30 -0
  137. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  138. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +27 -0
  139. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  140. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +41 -0
  141. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  142. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +301 -0
  143. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  144. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +126 -0
  145. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  146. package/lib/commonjs/package.json +73 -0
  147. package/lib/commonjs/react-native-builder-bob.config.js +13 -0
  148. package/lib/commonjs/react-native-builder-bob.config.js.map +1 -0
  149. package/lib/commonjs/src/AguaceroContext.js +11 -0
  150. package/lib/commonjs/src/AguaceroContext.js.map +1 -0
  151. package/lib/commonjs/src/GridRenderLayer.js +159 -0
  152. package/lib/commonjs/src/GridRenderLayer.js.map +1 -0
  153. package/lib/commonjs/src/GridRenderLayerNativeComponent.js +11 -0
  154. package/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -0
  155. package/lib/commonjs/src/MapManager.js +164 -0
  156. package/lib/commonjs/src/MapManager.js.map +1 -0
  157. package/lib/commonjs/src/MapRegistry.js +36 -0
  158. package/lib/commonjs/src/MapRegistry.js.map +1 -0
  159. package/lib/commonjs/src/StyleApplicator.js +262 -0
  160. package/lib/commonjs/src/StyleApplicator.js.map +1 -0
  161. package/lib/commonjs/src/WeatherLayerManager.js +731 -0
  162. package/lib/commonjs/src/WeatherLayerManager.js.map +1 -0
  163. package/lib/commonjs/tsconfig.json +24 -0
  164. package/lib/module/README.md +61 -0
  165. package/lib/module/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  166. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  167. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  168. package/lib/module/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  169. package/lib/module/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  170. package/lib/module/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  171. package/lib/module/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  172. package/lib/module/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  173. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  174. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  175. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  176. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  177. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  178. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  179. package/lib/module/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  180. package/lib/module/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  181. package/lib/module/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  182. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  183. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  184. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  185. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  186. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  187. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  188. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  189. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  190. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  191. package/lib/module/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  192. package/lib/module/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  193. package/lib/module/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  194. package/lib/module/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  195. package/lib/module/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  196. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  197. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  198. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +101 -0
  199. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  200. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  201. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  202. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  203. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  204. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  205. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  206. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  207. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  208. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  209. package/lib/module/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  210. package/lib/module/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  211. package/lib/module/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  212. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  213. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  214. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  215. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  216. package/lib/module/android/build.gradle +85 -0
  217. package/lib/module/android/src/main/AndroidManifest.xml +7 -0
  218. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +34 -0
  219. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +597 -0
  220. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +293 -0
  221. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +112 -0
  222. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +64 -0
  223. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +107 -0
  224. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +166 -0
  225. package/lib/module/android/src/main/res/raw/debug_fragment_shader.glsl +13 -0
  226. package/lib/module/android/src/main/res/raw/debug_vertex_shader.glsl +13 -0
  227. package/lib/module/android/src/main/res/raw/fragment_shader.glsl +98 -0
  228. package/lib/module/android/src/main/res/raw/vertex_shader.glsl +20 -0
  229. package/lib/module/babel.config.js +5 -0
  230. package/lib/module/babel.config.js.map +1 -0
  231. package/lib/module/index.js +3 -0
  232. package/lib/module/index.js.map +1 -0
  233. package/lib/module/lib/commonjs/README.md +61 -0
  234. package/lib/module/lib/commonjs/android/build.gradle +85 -0
  235. package/lib/module/lib/commonjs/android/src/main/AndroidManifest.xml +7 -0
  236. package/lib/module/lib/commonjs/babel.config.js +7 -0
  237. package/lib/module/lib/commonjs/babel.config.js.map +1 -0
  238. package/lib/module/lib/commonjs/index.js +20 -0
  239. package/lib/module/lib/commonjs/index.js.map +1 -0
  240. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  241. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  242. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  243. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  244. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  245. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  246. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  247. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  248. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  249. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  250. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  251. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  252. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  253. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  254. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  255. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  256. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  257. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  258. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  259. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  260. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  261. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +976 -0
  262. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  263. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +381 -0
  264. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  265. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1229 -0
  266. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  267. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4023 -0
  268. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  269. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +38 -0
  270. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  271. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +30 -0
  272. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  273. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +27 -0
  274. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  275. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +41 -0
  276. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  277. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +301 -0
  278. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  279. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +126 -0
  280. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  281. package/lib/module/lib/commonjs/package.json +73 -0
  282. package/lib/module/lib/commonjs/react-native-builder-bob.config.js +13 -0
  283. package/lib/module/lib/commonjs/react-native-builder-bob.config.js.map +1 -0
  284. package/lib/module/lib/commonjs/src/AguaceroContext.js +15 -0
  285. package/lib/module/lib/commonjs/src/AguaceroContext.js.map +1 -0
  286. package/lib/module/lib/commonjs/src/GridRenderLayer.js +182 -0
  287. package/lib/module/lib/commonjs/src/GridRenderLayer.js.map +1 -0
  288. package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js +15 -0
  289. package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -0
  290. package/lib/module/lib/commonjs/src/MapManager.js +187 -0
  291. package/lib/module/lib/commonjs/src/MapManager.js.map +1 -0
  292. package/lib/module/lib/commonjs/src/MapRegistry.js +36 -0
  293. package/lib/module/lib/commonjs/src/MapRegistry.js.map +1 -0
  294. package/lib/module/lib/commonjs/src/StyleApplicator.js +286 -0
  295. package/lib/module/lib/commonjs/src/StyleApplicator.js.map +1 -0
  296. package/lib/module/lib/commonjs/src/WeatherLayerManager.js +750 -0
  297. package/lib/module/lib/commonjs/src/WeatherLayerManager.js.map +1 -0
  298. package/lib/module/lib/commonjs/tsconfig.json +24 -0
  299. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  300. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  301. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  302. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  303. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  304. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  305. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  306. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  307. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  308. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  309. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  310. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  311. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  312. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  313. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  314. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  315. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  316. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  317. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  318. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  319. package/lib/module/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  320. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +964 -0
  321. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  322. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +375 -0
  323. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  324. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1223 -0
  325. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  326. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4017 -0
  327. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  328. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js +31 -0
  329. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  330. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +29 -0
  331. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  332. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +21 -0
  333. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  334. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js +12 -0
  335. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  336. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +295 -0
  337. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  338. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +119 -0
  339. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  340. package/lib/module/package.json +73 -0
  341. package/lib/module/react-native-builder-bob.config.js +11 -0
  342. package/lib/module/react-native-builder-bob.config.js.map +1 -0
  343. package/lib/module/src/AguaceroContext.js +5 -0
  344. package/lib/module/src/AguaceroContext.js.map +1 -0
  345. package/lib/module/src/GridRenderLayer.js +152 -0
  346. package/lib/module/src/GridRenderLayer.js.map +1 -0
  347. package/lib/module/src/GridRenderLayerNativeComponent.js +5 -0
  348. package/lib/module/src/GridRenderLayerNativeComponent.js.map +1 -0
  349. package/lib/module/src/MapManager.js +155 -0
  350. package/lib/module/src/MapManager.js.map +1 -0
  351. package/lib/module/src/MapRegistry.js +30 -0
  352. package/lib/module/src/MapRegistry.js.map +1 -0
  353. package/lib/module/src/StyleApplicator.js +255 -0
  354. package/lib/module/src/StyleApplicator.js.map +1 -0
  355. package/lib/module/src/WeatherLayerManager.js +724 -0
  356. package/lib/module/src/WeatherLayerManager.js.map +1 -0
  357. package/lib/module/tsconfig.json +24 -0
  358. package/lib/typescript/babel.config.d.ts +3 -0
  359. package/lib/typescript/babel.config.d.ts.map +1 -0
  360. package/lib/typescript/index.d.ts +3 -0
  361. package/lib/typescript/index.d.ts.map +1 -0
  362. package/lib/typescript/react-native-builder-bob.config.d.ts +6 -0
  363. package/lib/typescript/react-native-builder-bob.config.d.ts.map +1 -0
  364. package/lib/typescript/src/AguaceroContext.d.ts +2 -0
  365. package/lib/typescript/src/AguaceroContext.d.ts.map +1 -0
  366. package/lib/typescript/src/GridRenderLayer.d.ts +2 -0
  367. package/lib/typescript/src/GridRenderLayer.d.ts.map +1 -0
  368. package/lib/typescript/src/GridRenderLayerNativeComponent.d.ts +12 -0
  369. package/lib/typescript/src/GridRenderLayerNativeComponent.d.ts.map +1 -0
  370. package/lib/typescript/src/MapManager.d.ts +8 -0
  371. package/lib/typescript/src/MapManager.d.ts.map +1 -0
  372. package/lib/typescript/src/MapRegistry.d.ts +12 -0
  373. package/lib/typescript/src/MapRegistry.d.ts.map +1 -0
  374. package/lib/typescript/src/StyleApplicator.d.ts +4 -0
  375. package/lib/typescript/src/StyleApplicator.d.ts.map +1 -0
  376. package/lib/typescript/src/WeatherLayerManager.d.ts +2 -0
  377. package/lib/typescript/src/WeatherLayerManager.d.ts.map +1 -0
  378. package/package.json +56 -18
  379. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/WeatherFrameProcessorModule.class.uniqueId1 +0 -0
  380. package/src/AguaceroContext.js +0 -4
  381. package/src/GridRenderLayer.js +0 -121
  382. package/src/MapManager.js +0 -158
  383. package/src/MapRegistry.js +0 -35
  384. package/src/StyleApplicator.js +0 -241
  385. package/src/WeatherLayerManager.js +0 -754
  386. /package/{android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId0 → lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class} +0 -0
@@ -0,0 +1,750 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WeatherLayerManager = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _javascriptSdk = require("@aguacerowx/javascript-sdk");
9
+ var _AguaceroContext = require("./AguaceroContext");
10
+ var _GridRenderLayer = require("./GridRenderLayer");
11
+ var _base64Js = require("base64-js");
12
+ var _reactNative = require("react-native");
13
+ var _MapRegistry = require("./MapRegistry");
14
+ function _interopRequireWildcard(e, t) {
15
+ if ("function" == typeof WeakMap) var r = new WeakMap(),
16
+ n = new WeakMap();
17
+ return (_interopRequireWildcard = function (e, t) {
18
+ if (!t && e && e.__esModule) return e;
19
+ var o,
20
+ i,
21
+ f = {
22
+ __proto__: null,
23
+ default: e
24
+ };
25
+ if (null === e || "object" != typeof e && "function" != typeof e) return f;
26
+ if (o = t ? n : r) {
27
+ if (o.has(e)) return o.get(e);
28
+ o.set(e, f);
29
+ }
30
+ for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]);
31
+ return f;
32
+ })(e, t);
33
+ }
34
+ // packages/react-native/src/WeatherLayerManager.js
35
+
36
+ const {
37
+ WeatherFrameProcessorModule,
38
+ InspectorModule
39
+ } = _reactNative.NativeModules;
40
+
41
+ /**
42
+ * A helper function to generate the raw RGBA byte buffer for the colormap texture.
43
+ */
44
+ const _generateColormapBytes = colormap => {
45
+ const width = 256;
46
+ const data = new Uint8Array(width * 4);
47
+ const stops = colormap.reduce((acc, _, i) => i % 2 === 0 ? [...acc, {
48
+ value: colormap[i],
49
+ color: colormap[i + 1]
50
+ }] : acc, []);
51
+ if (stops.length === 0) return data;
52
+ const minVal = stops[0].value;
53
+ const maxVal = stops[stops.length - 1].value;
54
+ const hexToRgb = hex => {
55
+ const r = parseInt(hex.slice(1, 3), 16);
56
+ const g = parseInt(hex.slice(3, 5), 16);
57
+ const b = parseInt(hex.slice(5, 7), 16);
58
+ return [r, g, b];
59
+ };
60
+ for (let i = 0; i < width; i++) {
61
+ const val = minVal + i / (width - 1) * (maxVal - minVal);
62
+ let lower = stops[0];
63
+ let upper = stops[stops.length - 1];
64
+ for (let j = 0; j < stops.length - 1; j++) {
65
+ if (val >= stops[j].value && val <= stops[j + 1].value) {
66
+ lower = stops[j];
67
+ upper = stops[j + 1];
68
+ break;
69
+ }
70
+ }
71
+ const t = (val - lower.value) / (upper.value - lower.value || 1);
72
+ const lowerRgb = hexToRgb(lower.color);
73
+ const upperRgb = hexToRgb(upper.color);
74
+ const rgb = lowerRgb.map((c, idx) => c * (1 - t) + upperRgb[idx] * t);
75
+ const offset = i * 4;
76
+ data[offset + 0] = Math.round(rgb[0]);
77
+ data[offset + 1] = Math.round(rgb[1]);
78
+ data[offset + 2] = Math.round(rgb[2]);
79
+ data[offset + 3] = 255;
80
+ }
81
+ return data;
82
+ };
83
+ _javascriptSdk.AguaceroCore.prototype.setMapCenter = function (center) {
84
+ this.emit('map:move', center);
85
+ };
86
+ const WeatherLayerManager = exports.WeatherLayerManager = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
87
+ const {
88
+ inspectorEnabled,
89
+ onInspect,
90
+ apiKey,
91
+ customColormaps,
92
+ ...restProps
93
+ } = props;
94
+ const context = (0, _react.useContext)(_AguaceroContext.AguaceroContext);
95
+
96
+ // Create the core here instead of getting it from context
97
+ const core = (0, _react.useMemo)(() => new _javascriptSdk.AguaceroCore({
98
+ apiKey: apiKey,
99
+ customColormaps: customColormaps
100
+ }), [apiKey]);
101
+ const gridLayerRef = (0, _react.useRef)(null);
102
+ const currentGridDataRef = (0, _react.useRef)(null);
103
+
104
+ // Cache for preloaded grid data - stores the processed data ready for GPU upload
105
+ const preloadedDataCache = (0, _react.useRef)(new Map());
106
+
107
+ // Track what we're currently preloading to avoid duplicates
108
+ const preloadingSet = (0, _react.useRef)(new Set());
109
+
110
+ // Store geometry and colormap that don't change with forecast hour
111
+ const cachedGeometry = (0, _react.useRef)(null);
112
+ const cachedColormap = (0, _react.useRef)(null);
113
+ const cachedDataRange = (0, _react.useRef)([0, 1]);
114
+
115
+ // Track if we've done the initial load
116
+ const hasInitialLoad = (0, _react.useRef)(false);
117
+
118
+ // Track the last state we processed to avoid redundant updates
119
+ const lastProcessedState = (0, _react.useRef)(null);
120
+ const previousStateRef = (0, _react.useRef)(null);
121
+ const [renderProps, setRenderProps] = (0, _react.useState)({
122
+ opacity: 1,
123
+ dataRange: [0, 1]
124
+ });
125
+ (0, _react.useImperativeHandle)(ref, () => {
126
+ return {
127
+ play: () => {
128
+ core.play();
129
+ },
130
+ pause: () => {
131
+ core.pause();
132
+ },
133
+ togglePlay: () => {
134
+ core.togglePlay();
135
+ },
136
+ step: direction => {
137
+ core.step(direction);
138
+ },
139
+ setPlaybackSpeed: speed => core.setPlaybackSpeed(speed),
140
+ setOpacity: opacity => core.setOpacity(opacity),
141
+ setUnits: units => core.setUnits(units),
142
+ switchMode: options => core.switchMode(options),
143
+ getAvailableVariables: model => core.getAvailableVariables(model),
144
+ getVariableDisplayName: code => core.getVariableDisplayName(code),
145
+ setRun: runString => core.setState({
146
+ run: runString.split(':')[1]
147
+ }),
148
+ setState: newState => core.setState(newState),
149
+ setMRMSTimestamp: timestamp => core.setMRMSTimestamp(timestamp),
150
+ setSmoothing: enabled => {
151
+ if (gridLayerRef.current) {
152
+ gridLayerRef.current.setSmoothing(enabled);
153
+ }
154
+ }
155
+ };
156
+ }, [core]);
157
+ const preloadAllFramesToDisk = state => {
158
+ const {
159
+ isMRMS,
160
+ model,
161
+ date,
162
+ run,
163
+ variable,
164
+ units,
165
+ availableHours,
166
+ availableTimestamps
167
+ } = state;
168
+ const allFrames = isMRMS ? availableTimestamps : availableHours;
169
+ if (!allFrames || allFrames.length === 0) {
170
+ console.warn('🟡 [Preload To Disk] No frames available to download.');
171
+ return;
172
+ }
173
+ const {
174
+ corners,
175
+ gridDef
176
+ } = core._getGridCornersAndDef(isMRMS ? 'mrms' : model);
177
+ const {
178
+ nx,
179
+ ny
180
+ } = gridDef.grid_params;
181
+ for (const frame of allFrames) {
182
+ const cacheKey = isMRMS ? `mrms-${frame}-${variable}-${units}` : `${model}-${date}-${run}-${frame}-${variable}-${units}`;
183
+ if (preloadedDataCache.current.has(cacheKey)) {
184
+ continue; // Skip if already cached
185
+ }
186
+ let resourcePath;
187
+ if (isMRMS) {
188
+ const frameDate = new Date(frame * 1000);
189
+ const y = frameDate.getUTCFullYear();
190
+ const m = (frameDate.getUTCMonth() + 1).toString().padStart(2, '0');
191
+ const d = frameDate.getUTCDate().toString().padStart(2, '0');
192
+ resourcePath = `/grids/mrms/${y}${m}${d}/${frame}/0/${variable}/0`;
193
+ } else {
194
+ resourcePath = `/grids/${model}/${date}/${run}/${frame}/${variable}/0`;
195
+ }
196
+ const url = `${core.baseGridUrl}${resourcePath}?apiKey=${core.apiKey}`;
197
+ const options = {
198
+ url,
199
+ apiKey: core.apiKey,
200
+ bundleId: core.bundleId
201
+ };
202
+
203
+ // Assumes your native module has a method 'processFrameAndSave' that saves to a file
204
+ // and returns a { filePath, scale, offset, missing } object in the callback.
205
+ WeatherFrameProcessorModule.processFrame(options, (error, result) => {
206
+ if (error || !result.filePath) {
207
+ console.error(`❌ [Native Save Error] for frame ${frame}:`, error || "Result has no filePath");
208
+ return;
209
+ }
210
+
211
+ // Cache is now extremely lightweight, just storing metadata and a path.
212
+ preloadedDataCache.current.set(cacheKey, {
213
+ filePath: result.filePath,
214
+ nx,
215
+ ny,
216
+ scale: result.scale,
217
+ offset: result.offset,
218
+ missing: result.missing,
219
+ corners,
220
+ gridDef,
221
+ scaleType: result.scaleType // FIX: Add scaleType to the preloaded data cache
222
+ });
223
+ });
224
+ }
225
+ };
226
+
227
+ /**
228
+ * FINAL VERSION: Updates the GPU by reading from the cache and calling the correct
229
+ * native render function (either from a file path or from a Base64 string).
230
+ */
231
+ const updateGPUWithCachedData = state => {
232
+ const {
233
+ model,
234
+ date,
235
+ run,
236
+ forecastHour,
237
+ variable,
238
+ units,
239
+ isMRMS,
240
+ mrmsTimestamp
241
+ } = state;
242
+ const cacheKey = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${units}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${units}`;
243
+ const cachedData = preloadedDataCache.current.get(cacheKey);
244
+ if (!cachedData) {
245
+ const timeKey = isMRMS ? `timestamp ${mrmsTimestamp}` : `hour +${forecastHour}`;
246
+ console.warn(`⚠️ [GPU Update] No cached data for ${timeKey}. Key not found: ${cacheKey}`);
247
+ return false;
248
+ }
249
+ if (!gridLayerRef.current) {
250
+ console.error(`❌ [GPU Update] GridLayer ref not available`);
251
+ return false;
252
+ }
253
+ if (!cachedGeometry.current || cachedGeometry.current.model !== (isMRMS ? 'mrms' : model) || cachedGeometry.current.variable !== variable) {
254
+ gridLayerRef.current.updateGeometry(cachedData.corners, cachedData.gridDef);
255
+ cachedGeometry.current = {
256
+ model: isMRMS ? 'mrms' : model,
257
+ variable
258
+ };
259
+ }
260
+ const colormapKey = `${variable}-${units}`;
261
+ if (!cachedColormap.current || cachedColormap.current.key !== colormapKey) {
262
+ const {
263
+ colormap,
264
+ baseUnit
265
+ } = core._getColormapForVariable(variable);
266
+ const toUnit = core._getTargetUnit(baseUnit, units);
267
+ const finalColormap = core._convertColormapUnits(colormap, baseUnit, toUnit);
268
+ const dataRange = [finalColormap[0], finalColormap[finalColormap.length - 2]];
269
+ const colormapBytes = _generateColormapBytes(finalColormap);
270
+ const colormapAsBase64 = (0, _base64Js.fromByteArray)(colormapBytes);
271
+ gridLayerRef.current.updateColormapTexture(colormapAsBase64);
272
+ cachedColormap.current = {
273
+ key: colormapKey
274
+ };
275
+ cachedDataRange.current = dataRange;
276
+ setRenderProps(prev => ({
277
+ ...prev,
278
+ dataRange
279
+ }));
280
+ }
281
+
282
+ // UPDATE GPU
283
+ if (cachedData.filePath) {
284
+ gridLayerRef.current.updateDataTextureFromFile(cachedData.filePath, cachedData.nx, cachedData.ny, cachedData.scale, cachedData.offset, cachedData.missing, cachedData.scaleType);
285
+ } else if (cachedData.dataAsBase64) {
286
+ gridLayerRef.current.updateDataTexture(cachedData.dataAsBase64, cachedData.nx, cachedData.ny, cachedData.scale, cachedData.offset, cachedData.missing, cachedData.scaleType);
287
+
288
+ // ADD THIS: Update the inspector cache when using dataAsBase64
289
+ const binaryString = atob(cachedData.dataAsBase64);
290
+ const uint8Array = new Uint8Array(binaryString.length);
291
+ for (let i = 0; i < binaryString.length; i++) {
292
+ uint8Array[i] = binaryString.charCodeAt(i);
293
+ }
294
+ currentGridDataRef.current = {
295
+ data: uint8Array,
296
+ nx: cachedData.nx,
297
+ ny: cachedData.ny,
298
+ scale: cachedData.scale,
299
+ offset: cachedData.offset,
300
+ missing: cachedData.missing,
301
+ gridDef: cachedData.gridDef,
302
+ variable: variable,
303
+ units: units
304
+ };
305
+ } else {
306
+ console.error(`❌ [GPU Update] Cached data for key ${cacheKey} has no filePath or dataAsBase64.`);
307
+ return false;
308
+ }
309
+
310
+ // ADD THIS: Update inspector parameters for file-based data too
311
+ if (gridLayerRef.current && gridLayerRef.current.updateDataParameters) {
312
+ gridLayerRef.current.updateDataParameters(cachedData.scale, cachedData.offset, cachedData.missing);
313
+ }
314
+ return true;
315
+ };
316
+ const handleStateChangeRef = (0, _react.useRef)(null);
317
+ const debounceTimeoutRef = (0, _react.useRef)(null);
318
+ (0, _react.useEffect)(() => {
319
+ if (core && props.customColormaps) {
320
+ core.customColormaps = props.customColormaps;
321
+ // Trigger a re-render if we already have data loaded
322
+ if (hasInitialLoad.current) {
323
+ core._emitStateChange();
324
+ }
325
+ }
326
+ }, [core, props.customColormaps]);
327
+ const getValueAtPoint = async (lng, lat) => {
328
+ if (!core) {
329
+ console.warn('🔍 [Inspector] Core not available');
330
+ return null;
331
+ }
332
+ try {
333
+ const gridIndices = core._getGridIndexFromLngLat(lng, lat);
334
+ if (!gridIndices) return null;
335
+ const {
336
+ i,
337
+ j
338
+ } = gridIndices;
339
+
340
+ // The native module uses the cached scale/offset which we update via updateDataParameters
341
+ const value = await InspectorModule.getValueAtGridIndex(i, j);
342
+ if (value === null) {
343
+ return null;
344
+ }
345
+ const {
346
+ colormap,
347
+ baseUnit
348
+ } = core._getColormapForVariable(core.state.variable);
349
+ const displayUnit = core._getTargetUnit(baseUnit, core.state.units);
350
+
351
+ // Get the converted colormap to check min threshold
352
+ const finalColormap = core._convertColormapUnits(colormap, baseUnit, displayUnit);
353
+ const minThreshold = finalColormap[0]; // First value in colormap is the minimum
354
+
355
+ // Filter out values below the minimum threshold (matching shader behavior)
356
+ if (value < minThreshold) {
357
+ return null;
358
+ }
359
+
360
+ // Also check if value is NaN or effectively missing
361
+ if (!isFinite(value)) {
362
+ return null;
363
+ }
364
+ return {
365
+ value: value,
366
+ unit: displayUnit,
367
+ variable: {
368
+ code: core.state.variable,
369
+ name: core.getVariableDisplayName(core.state.variable)
370
+ },
371
+ lngLat: {
372
+ lng,
373
+ lat
374
+ }
375
+ };
376
+ } catch (error) {
377
+ console.error('🔍 [Inspector] Error:', error);
378
+ return null;
379
+ }
380
+ };
381
+ (0, _react.useEffect)(() => {
382
+ if (!core) {
383
+ console.warn('⚠️ [useEffect] Core is not available yet');
384
+ return;
385
+ }
386
+ const handleStateChange = async newState => {
387
+ if (!previousStateRef.current) {
388
+ previousStateRef.current = core.state;
389
+ }
390
+ const stateKey = `${newState.model}-${newState.variable}-${newState.date}-${newState.run}-${newState.forecastHour}-${newState.units}-${newState.mrmsTimestamp}`;
391
+ const isOpacityOnlyChange = hasInitialLoad.current && newState.opacity !== renderProps.opacity && newState.variable === previousStateRef.current?.variable && newState.forecastHour === previousStateRef.current?.forecastHour && newState.mrmsTimestamp === previousStateRef.current?.mrmsTimestamp && newState.model === previousStateRef.current?.model && newState.units === previousStateRef.current?.units;
392
+ if (!isOpacityOnlyChange && lastProcessedState.current === stateKey) {
393
+ return;
394
+ }
395
+ if (!isOpacityOnlyChange) {
396
+ lastProcessedState.current = stateKey;
397
+ }
398
+ props.onStateChange?.(newState);
399
+ if (isOpacityOnlyChange) {
400
+ setRenderProps(prev => ({
401
+ ...prev,
402
+ opacity: newState.opacity
403
+ }));
404
+ previousStateRef.current = newState;
405
+ return;
406
+ }
407
+ // Check if only units changed
408
+ const isUnitsOnlyChange = hasInitialLoad.current && newState.model === previousStateRef.current.model && newState.isMRMS === previousStateRef.current.isMRMS && newState.variable === previousStateRef.current.variable && newState.date === previousStateRef.current.date && newState.run === previousStateRef.current.run && newState.forecastHour === previousStateRef.current.forecastHour && newState.mrmsTimestamp === previousStateRef.current.mrmsTimestamp && newState.units !== previousStateRef.current.units;
409
+ if (isUnitsOnlyChange) {
410
+ const {
411
+ variable,
412
+ units,
413
+ isMRMS,
414
+ mrmsTimestamp,
415
+ model,
416
+ date,
417
+ run,
418
+ forecastHour
419
+ } = newState;
420
+ const oldCacheKey = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${previousStateRef.current.units}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${previousStateRef.current.units}`;
421
+ const cachedData = preloadedDataCache.current.get(oldCacheKey);
422
+ if (cachedData && cachedData.originalScale !== undefined && cachedData.originalOffset !== undefined) {
423
+ const {
424
+ baseUnit
425
+ } = core._getColormapForVariable(variable);
426
+ const toUnit = core._getTargetUnit(baseUnit, units);
427
+ let dataScale = cachedData.originalScale;
428
+ let dataOffset = cachedData.originalOffset;
429
+ if (baseUnit !== toUnit) {
430
+ const conversionFunc = (0, _javascriptSdk.getUnitConversionFunction)(baseUnit, toUnit); // ✅ Use SDK function
431
+ if (conversionFunc) {
432
+ const convertedOffset = conversionFunc(dataOffset);
433
+ const convertedOffsetPlusScale = conversionFunc(dataOffset + dataScale);
434
+ dataScale = convertedOffsetPlusScale - convertedOffset;
435
+ dataOffset = convertedOffset;
436
+ }
437
+ }
438
+
439
+ // ONLY update the inspector cache parameters - don't touch GPU or colormap!
440
+ if (gridLayerRef.current && gridLayerRef.current.updateDataParameters) {
441
+ gridLayerRef.current.updateDataParameters(dataScale, dataOffset, cachedData.missing);
442
+ }
443
+
444
+ // Create new cache entry with new units
445
+ const newCacheKey = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${units}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${units}`;
446
+ preloadedDataCache.current.set(newCacheKey, {
447
+ ...cachedData,
448
+ scale: dataScale,
449
+ offset: dataOffset
450
+ });
451
+ }
452
+ previousStateRef.current = newState;
453
+ if (newState.opacity !== renderProps.opacity) {
454
+ setRenderProps(prev => ({
455
+ ...prev,
456
+ opacity: newState.opacity
457
+ }));
458
+ }
459
+ return;
460
+ }
461
+ const needsFullLoad = !hasInitialLoad.current || newState.model !== previousStateRef.current.model || newState.isMRMS !== previousStateRef.current.isMRMS || newState.variable !== previousStateRef.current.variable || newState.date !== previousStateRef.current.date || newState.run !== previousStateRef.current.run;
462
+ // REMOVED: || newState.units !== previousStateRef.current.units;
463
+
464
+ if (needsFullLoad) {
465
+ preloadedDataCache.current.clear();
466
+ cachedGeometry.current = null;
467
+ cachedColormap.current = null;
468
+ WeatherFrameProcessorModule.cancelAllFrames();
469
+ if (!newState.variable) {
470
+ previousStateRef.current = newState;
471
+ return;
472
+ }
473
+ try {
474
+ const {
475
+ model,
476
+ date,
477
+ run,
478
+ forecastHour,
479
+ variable,
480
+ units,
481
+ isMRMS,
482
+ mrmsTimestamp
483
+ } = newState;
484
+ const gridModel = isMRMS ? 'mrms' : model;
485
+ const {
486
+ corners,
487
+ gridDef
488
+ } = core._getGridCornersAndDef(gridModel);
489
+ const {
490
+ nx,
491
+ ny
492
+ } = gridDef.grid_params;
493
+ let resourcePath;
494
+ if (isMRMS) {
495
+ if (!mrmsTimestamp) {
496
+ previousStateRef.current = newState;
497
+ return;
498
+ }
499
+ const mrmsDate = new Date(mrmsTimestamp * 1000);
500
+ const y = mrmsDate.getUTCFullYear();
501
+ const m = (mrmsDate.getUTCMonth() + 1).toString().padStart(2, '0');
502
+ const d = mrmsDate.getUTCDate().toString().padStart(2, '0');
503
+ resourcePath = `/grids/mrms/${y}${m}${d}/${mrmsTimestamp}/0/${variable}/0`;
504
+ } else {
505
+ resourcePath = `/grids/${model}/${date}/${run}/${forecastHour}/${variable}/0`;
506
+ }
507
+ const url = `${core.baseGridUrl}${resourcePath}?apiKey=${core.apiKey}`;
508
+ const options = {
509
+ url,
510
+ apiKey: core.apiKey,
511
+ bundleId: core.bundleId
512
+ };
513
+ const result = await new Promise((resolve, reject) => {
514
+ WeatherFrameProcessorModule.processFrame(options, (error, res) => {
515
+ if (error) reject(new Error(error));else resolve(res);
516
+ });
517
+ });
518
+ if (result && gridLayerRef.current) {
519
+ gridLayerRef.current.updateGeometry(corners, gridDef);
520
+ cachedGeometry.current = {
521
+ model: gridModel,
522
+ variable
523
+ };
524
+ const {
525
+ colormap,
526
+ baseUnit
527
+ } = core._getColormapForVariable(variable);
528
+ const toUnit = core._getTargetUnit(baseUnit, units);
529
+ let dataScale = result.scale;
530
+ let dataOffset = result.offset;
531
+
532
+ // Store original scale/offset for unit conversion later
533
+ const originalScale = result.scale;
534
+ const originalOffset = result.offset;
535
+ if (baseUnit !== toUnit) {
536
+ const conversionFunc = (0, _javascriptSdk.getUnitConversionFunction)(baseUnit, toUnit); // ✅ Use SDK function
537
+ if (conversionFunc) {
538
+ const convertedOffset = conversionFunc(dataOffset);
539
+ const convertedOffsetPlusScale = conversionFunc(dataOffset + dataScale);
540
+ dataScale = convertedOffsetPlusScale - convertedOffset;
541
+ dataOffset = convertedOffset;
542
+ }
543
+ }
544
+ if (result.dataAsBase64) {
545
+ const binaryString = atob(result.dataAsBase64);
546
+ const uint8Array = new Uint8Array(binaryString.length);
547
+ for (let i = 0; i < binaryString.length; i++) {
548
+ uint8Array[i] = binaryString.charCodeAt(i);
549
+ }
550
+ currentGridDataRef.current = {
551
+ data: uint8Array,
552
+ nx,
553
+ ny,
554
+ scale: dataScale,
555
+ offset: dataOffset,
556
+ missing: result.missing,
557
+ gridDef: gridDef,
558
+ variable: variable,
559
+ units: units
560
+ };
561
+ }
562
+
563
+ // Now upload to GPU
564
+ if (result.filePath) {
565
+ gridLayerRef.current.updateDataTextureFromFile(result.filePath, nx, ny, dataScale, dataOffset, result.missing, result.scaleType);
566
+ } else if (result.dataAsBase64) {
567
+ gridLayerRef.current.updateDataTexture(result.dataAsBase64, nx, ny, dataScale, dataOffset, result.missing, result.scaleType);
568
+ }
569
+ const finalColormap = core._convertColormapUnits(colormap, baseUnit, toUnit);
570
+ const dataRange = [finalColormap[0], finalColormap[finalColormap.length - 2]];
571
+ const colormapBytes = _generateColormapBytes(finalColormap);
572
+ const colormapAsBase64 = (0, _base64Js.fromByteArray)(colormapBytes);
573
+ gridLayerRef.current.updateColormapTexture(colormapAsBase64);
574
+ cachedColormap.current = {
575
+ key: `${variable}-${units}`
576
+ };
577
+ cachedDataRange.current = dataRange;
578
+ setRenderProps({
579
+ opacity: newState.opacity,
580
+ dataRange: dataRange
581
+ });
582
+ hasInitialLoad.current = true;
583
+ const cacheKey = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${units}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${units}`;
584
+ const dataToCache = {
585
+ nx,
586
+ ny,
587
+ scale: dataScale,
588
+ offset: dataOffset,
589
+ originalScale: originalScale,
590
+ // Store original for unit conversion
591
+ originalOffset: originalOffset,
592
+ // Store original for unit conversion
593
+ missing: result.missing,
594
+ corners,
595
+ gridDef
596
+ };
597
+ if (result.filePath) dataToCache.filePath = result.filePath;
598
+ if (result.dataAsBase64) dataToCache.dataAsBase64 = result.dataAsBase64;
599
+ if (result.scaleType) dataToCache.scaleType = result.scaleType;
600
+ preloadedDataCache.current.set(cacheKey, dataToCache);
601
+ preloadAllFramesToDisk(newState);
602
+ }
603
+ } catch (error) {
604
+ console.error("❌ [State Change] Failed to load initial frame via native module:", error);
605
+ }
606
+ } else if (newState.forecastHour !== previousStateRef.current.forecastHour || newState.isMRMS && newState.mrmsTimestamp !== previousStateRef.current.mrmsTimestamp) {
607
+ updateGPUWithCachedData(newState);
608
+ if (newState.opacity !== renderProps.opacity) {
609
+ setRenderProps(prev => ({
610
+ ...prev,
611
+ opacity: newState.opacity
612
+ }));
613
+ }
614
+ }
615
+ previousStateRef.current = newState;
616
+ };
617
+ handleStateChangeRef.current = handleStateChange;
618
+ const stableHandler = newState => {
619
+ const isOpacityOnlyChange = previousStateRef.current && newState.opacity !== previousStateRef.current.opacity && newState.variable === previousStateRef.current.variable && newState.forecastHour === previousStateRef.current.forecastHour && newState.mrmsTimestamp === previousStateRef.current.mrmsTimestamp && newState.model === previousStateRef.current.model && newState.units === previousStateRef.current.units && newState.date === previousStateRef.current.date && newState.run === previousStateRef.current.run;
620
+ if (isOpacityOnlyChange) {
621
+ if (handleStateChangeRef.current) {
622
+ handleStateChangeRef.current(newState);
623
+ }
624
+ return;
625
+ }
626
+ if (debounceTimeoutRef.current) {
627
+ clearTimeout(debounceTimeoutRef.current);
628
+ }
629
+ debounceTimeoutRef.current = setTimeout(() => {
630
+ if (handleStateChangeRef.current) {
631
+ handleStateChangeRef.current(newState);
632
+ }
633
+ debounceTimeoutRef.current = null;
634
+ }, 50);
635
+ };
636
+ core.on('state:change', stableHandler);
637
+ return () => {
638
+ core.off('state:change', stableHandler);
639
+ if (debounceTimeoutRef.current) {
640
+ clearTimeout(debounceTimeoutRef.current);
641
+ }
642
+ };
643
+ }, [core]);
644
+ (0, _react.useEffect)(() => {
645
+ return () => {
646
+ preloadedDataCache.current.clear();
647
+ hasInitialLoad.current = false;
648
+ lastProcessedState.current = null;
649
+ };
650
+ }, []);
651
+ const lastInspectorUpdateRef = (0, _react.useRef)(0);
652
+ const INSPECTOR_THROTTLE_MS = 50;
653
+ (0, _react.useEffect)(() => {
654
+ if (!core || !inspectorEnabled) {
655
+ return;
656
+ }
657
+ const handleMapMove = async center => {
658
+ if (!center || !Array.isArray(center) || center.length !== 2) {
659
+ return;
660
+ }
661
+
662
+ // Throttle updates
663
+ const now = Date.now();
664
+ if (now - lastInspectorUpdateRef.current < INSPECTOR_THROTTLE_MS) {
665
+ return;
666
+ }
667
+ lastInspectorUpdateRef.current = now;
668
+ const [longitude, latitude] = center;
669
+ const payload = await getValueAtPoint(longitude, latitude);
670
+ onInspect?.(payload);
671
+ };
672
+ core.on('map:move', handleMapMove);
673
+ if (context && context.getCenter) {
674
+ const center = context.getCenter();
675
+ if (center) {
676
+ handleMapMove(center);
677
+ }
678
+ }
679
+ return () => {
680
+ core.off('map:move', handleMapMove);
681
+ };
682
+ }, [inspectorEnabled, onInspect, core, context]);
683
+
684
+ // Add this new useEffect after the existing inspector useEffect
685
+ (0, _react.useEffect)(() => {
686
+ // Trigger re-inspection when state changes (variable, model, forecast hour, etc.)
687
+ if (!core || !inspectorEnabled) {
688
+ return;
689
+ }
690
+ const triggerReinspection = () => {
691
+ const mapRef = _MapRegistry.mapRegistry.getMap();
692
+ const center = mapRef?._currentCenter;
693
+ if (center && Array.isArray(center) && center.length === 2) {
694
+ const [longitude, latitude] = center;
695
+ getValueAtPoint(longitude, latitude).then(payload => {
696
+ onInspect?.(payload);
697
+ });
698
+ }
699
+ };
700
+
701
+ // Small delay to ensure data is loaded before re-inspecting
702
+ const timer = setTimeout(triggerReinspection, 100);
703
+ return () => clearTimeout(timer);
704
+ }, [core?.state?.variable, core?.state?.model, core?.state?.forecastHour, core?.state?.mrmsTimestamp, core?.state?.units, inspectorEnabled, onInspect]);
705
+ (0, _react.useEffect)(() => {
706
+ if (!core) {
707
+ return;
708
+ }
709
+ const handleCameraChange = center => {
710
+ if (core && center) {
711
+ core.setMapCenter(center);
712
+ }
713
+ };
714
+
715
+ // Register with the global registry
716
+ _MapRegistry.mapRegistry.addCameraListener(handleCameraChange);
717
+
718
+ // Try to get initial center
719
+ const mapRef = _MapRegistry.mapRegistry.getMap();
720
+ if (mapRef?._currentCenter) {
721
+ handleCameraChange(mapRef._currentCenter);
722
+ }
723
+ return () => {
724
+ _MapRegistry.mapRegistry.removeCameraListener(handleCameraChange);
725
+ };
726
+ }, [core]);
727
+ (0, _react.useEffect)(() => {
728
+ core.initialize();
729
+ return () => {
730
+ core.destroy();
731
+ };
732
+ }, [core]);
733
+ return /*#__PURE__*/_react.default.createElement(_GridRenderLayer.GridRenderLayer, {
734
+ ref: gridLayerRef,
735
+ opacity: renderProps.opacity,
736
+ dataRange: renderProps.dataRange,
737
+ belowID: "AML_-_terrain"
738
+ });
739
+ });
740
+ WeatherLayerManager.getAvailableVariables = options => {
741
+ if (!options || !options.apiKey) {
742
+ console.error("API key must be provided to get available variables.");
743
+ return [];
744
+ }
745
+ const core = new _javascriptSdk.AguaceroCore({
746
+ apiKey: options.apiKey
747
+ });
748
+ return core.getAvailableVariables('mrms');
749
+ };
750
+ //# sourceMappingURL=WeatherLayerManager.js.map