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