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