@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,597 @@
1
+ // packages/react-native/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java
2
+
3
+ package com.aguacerowx.reactnative;
4
+
5
+ import android.content.Context;
6
+ import android.opengl.GLES20;
7
+ import android.util.Log;
8
+
9
+ import com.facebook.react.bridge.ReadableArray;
10
+ import com.facebook.react.bridge.ReadableMap;
11
+ import com.mapbox.maps.CustomLayerHost;
12
+ import com.mapbox.maps.CustomLayerRenderParameters;
13
+
14
+ import java.io.InputStream;
15
+ import java.nio.ByteBuffer;
16
+ import java.nio.ByteOrder;
17
+ import java.nio.FloatBuffer;
18
+ import java.nio.ShortBuffer;
19
+ import java.util.ArrayList;
20
+ import java.util.List;
21
+ import java.util.Scanner;
22
+
23
+ import java.io.File;
24
+ import java.io.FileInputStream;
25
+ import java.io.IOException;
26
+ import com.github.luben.zstd.Zstd;
27
+
28
+ public class GridRenderLayer implements CustomLayerHost {
29
+ private final Context context;
30
+ private final String TAG = "AguaceroWX";
31
+ private int program;
32
+
33
+ // Uniform and Attribute locations
34
+ private int uMatrix, uDataTexture, uColormapTexture, uOpacity, uDataRange,
35
+ uScale, uOffset, uMissingQuantized, uTextureSize, uConversionType, uSmoothing,
36
+ uScaleType;
37
+ private int aPosition, aTexCoord;
38
+
39
+ // GPU-side resource IDs
40
+ private int dataTextureId = 0;
41
+ private int colormapTextureId = 0;
42
+ private int vboId = 0;
43
+ private int iboId = 0;
44
+ private int indexCount = 0;
45
+
46
+ // Layer properties
47
+ private float opacity = 1.0f;
48
+ private float[] dataRange = new float[]{0.0f, 1.0f};
49
+ private float scale = 1.0f;
50
+ private float offset = 0.0f;
51
+ private float missingQuantized = 127.0f;
52
+ private int textureWidth = 0;
53
+ private int textureHeight = 0;
54
+ private int conversionType = 0;
55
+ private boolean smoothingEnabled = true;
56
+ private int scaleType = 0;
57
+ private boolean textureParametersDirty = true;
58
+
59
+ // Pending data buffers for thread-safe uploads
60
+ private final Object dataLock = new Object();
61
+ private ByteBuffer pendingDataBuffer = null;
62
+ private int pendingNx = 0, pendingNy = 0;
63
+ private float pendingScale = 1.0f, pendingOffset = 0.0f, pendingMissing = 127.0f;
64
+ private int pendingScaleType = 0;
65
+ private ByteBuffer pendingColormapBuffer = null;
66
+ private FloatBuffer pendingVertexBuffer = null;
67
+ private ShortBuffer pendingIndexBuffer = null;
68
+
69
+
70
+ public GridRenderLayer(Context context) {
71
+ this.context = context;
72
+ }
73
+
74
+ private double getDouble(ReadableMap map, String key, double defaultValue) {
75
+ return map.hasKey(key) ? map.getDouble(key) : defaultValue;
76
+ }
77
+
78
+ private String loadShaderSource(int resourceId) {
79
+ InputStream inputStream = context.getResources().openRawResource(resourceId);
80
+ return new Scanner(inputStream).useDelimiter("\\A").next();
81
+ }
82
+
83
+ private int createShader(int type, String source) {
84
+ int shader = GLES20.glCreateShader(type);
85
+ if (shader == 0) return 0;
86
+ GLES20.glShaderSource(shader, source);
87
+ GLES20.glCompileShader(shader);
88
+ final int[] compileStatus = new int[1];
89
+ GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
90
+ if (compileStatus[0] == 0) {
91
+ Log.e(TAG, "Error compiling shader: " + GLES20.glGetShaderInfoLog(shader));
92
+ GLES20.glDeleteShader(shader);
93
+ return 0;
94
+ }
95
+ return shader;
96
+ }
97
+
98
+ @Override
99
+ public void initialize() {
100
+ String vertexSource = loadShaderSource(R.raw.vertex_shader);
101
+ String fragmentSource = loadShaderSource(R.raw.fragment_shader);
102
+ int vertexShader = createShader(GLES20.GL_VERTEX_SHADER, vertexSource);
103
+ int fragmentShader = createShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
104
+
105
+ program = GLES20.glCreateProgram();
106
+ GLES20.glAttachShader(program, vertexShader);
107
+ GLES20.glAttachShader(program, fragmentShader);
108
+ GLES20.glLinkProgram(program);
109
+
110
+ uMatrix = GLES20.glGetUniformLocation(program, "u_matrix");
111
+ uDataTexture = GLES20.glGetUniformLocation(program, "u_data_texture");
112
+ uColormapTexture = GLES20.glGetUniformLocation(program, "u_colormap_texture");
113
+ uOpacity = GLES20.glGetUniformLocation(program, "u_opacity");
114
+ uDataRange = GLES20.glGetUniformLocation(program, "u_data_range");
115
+ uScale = GLES20.glGetUniformLocation(program, "u_scale");
116
+ uOffset = GLES20.glGetUniformLocation(program, "u_offset");
117
+ uMissingQuantized = GLES20.glGetUniformLocation(program, "u_missing_quantized");
118
+ uTextureSize = GLES20.glGetUniformLocation(program, "u_texture_size");
119
+ uConversionType = GLES20.glGetUniformLocation(program, "u_conversion_type");
120
+ uSmoothing = GLES20.glGetUniformLocation(program, "u_smoothing");
121
+ uScaleType = GLES20.glGetUniformLocation(program, "u_scale_type");
122
+ aPosition = GLES20.glGetAttribLocation(program, "a_position");
123
+ aTexCoord = GLES20.glGetAttribLocation(program, "a_texCoord");
124
+ }
125
+
126
+ @Override
127
+ public void render(CustomLayerRenderParameters renderParameters) {
128
+ if (program == 0) return;
129
+
130
+ synchronized (dataLock) {
131
+ if (pendingVertexBuffer != null && pendingIndexBuffer != null) {
132
+ this.indexCount = pendingIndexBuffer.capacity();
133
+ if (vboId == 0) {
134
+ int[] bufs = new int[2];
135
+ GLES20.glGenBuffers(2, bufs, 0);
136
+ vboId = bufs[0];
137
+ iboId = bufs[1];
138
+ }
139
+ GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vboId);
140
+ GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, pendingVertexBuffer.capacity() * 4, pendingVertexBuffer, GLES20.GL_STATIC_DRAW);
141
+ GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, iboId);
142
+ GLES20.glBufferData(GLES20.GL_ELEMENT_ARRAY_BUFFER, pendingIndexBuffer.capacity() * 2, pendingIndexBuffer, GLES20.GL_STATIC_DRAW);
143
+ pendingVertexBuffer = null;
144
+ pendingIndexBuffer = null;
145
+ }
146
+
147
+ if (pendingDataBuffer != null) {
148
+ // --- FIX 2: LOGICAL FIX FOR TEXTURE RESIZING ---
149
+ boolean dimensionsChanged = (pendingNx != this.textureWidth || pendingNy != this.textureHeight);
150
+
151
+ this.textureWidth = pendingNx;
152
+ this.textureHeight = pendingNy;
153
+ this.scale = pendingScale;
154
+ this.offset = pendingOffset;
155
+ this.missingQuantized = pendingMissing;
156
+ this.scaleType = pendingScaleType;
157
+
158
+ if (dataTextureId == 0) {
159
+ int[] t = new int[1];
160
+ GLES20.glGenTextures(1, t, 0);
161
+ dataTextureId = t[0];
162
+ }
163
+
164
+ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, dataTextureId);
165
+
166
+ if (dimensionsChanged || dataTextureId == 0) {
167
+ int filter = smoothingEnabled ? GLES20.GL_LINEAR : GLES20.GL_NEAREST;
168
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, filter);
169
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, filter);
170
+
171
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
172
+
173
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
174
+ GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1);
175
+
176
+ pendingDataBuffer.position(0);
177
+ GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_ALPHA, pendingNx, pendingNy, 0, GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, pendingDataBuffer);
178
+ } else {
179
+ // Texture dimensions are the same, so just update its contents efficiently
180
+ pendingDataBuffer.position(0);
181
+ GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, pendingNx, pendingNy, GLES20.GL_ALPHA, GLES20.GL_UNSIGNED_BYTE, pendingDataBuffer);
182
+ }
183
+ pendingDataBuffer = null;
184
+ }
185
+
186
+ if (pendingColormapBuffer != null) {
187
+ if (colormapTextureId == 0) {
188
+ int[] t = new int[1];
189
+ GLES20.glGenTextures(1, t, 0);
190
+ colormapTextureId = t[0];
191
+ }
192
+ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, colormapTextureId);
193
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
194
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
195
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
196
+ pendingColormapBuffer.position(0);
197
+ GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, 256, 1, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, pendingColormapBuffer);
198
+ pendingColormapBuffer = null;
199
+ }
200
+ }
201
+
202
+ double zoom = renderParameters.getZoom();
203
+
204
+ if (vboId == 0 || iboId == 0 || indexCount == 0 || dataTextureId == 0 || colormapTextureId == 0) return;
205
+
206
+ if (textureParametersDirty) {
207
+ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, dataTextureId);
208
+ int filter = smoothingEnabled ? GLES20.GL_LINEAR : GLES20.GL_NEAREST;
209
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, filter);
210
+ GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, filter);
211
+ textureParametersDirty = false;
212
+ }
213
+
214
+ GLES20.glUseProgram(program);
215
+
216
+ double scale = Math.pow(2.0, zoom);
217
+
218
+ List<Double> matrix = renderParameters.getProjectionMatrix();
219
+ float[] floatMatrix = new float[16];
220
+ for (int i = 0; i < 16; i++) {
221
+ floatMatrix[i] = matrix.get(i).floatValue();
222
+ }
223
+
224
+ floatMatrix[0] *= scale;
225
+ floatMatrix[5] *= scale;
226
+
227
+ GLES20.glUniformMatrix4fv(uMatrix, 1, false, floatMatrix, 0);
228
+ GLES20.glUniform1f(uOpacity, opacity);
229
+ GLES20.glUniform2fv(uDataRange, 1, dataRange, 0);
230
+ GLES20.glUniform1f(uScale, this.scale);
231
+ GLES20.glUniform1f(uOffset, offset);
232
+ GLES20.glUniform1f(uMissingQuantized, missingQuantized);
233
+ GLES20.glUniform2f(uTextureSize, (float) textureWidth, (float) textureHeight);
234
+ GLES20.glUniform1i(uConversionType, conversionType);
235
+ GLES20.glUniform1i(uSmoothing, smoothingEnabled ? 1 : 0);
236
+ GLES20.glUniform1i(uScaleType, this.scaleType);
237
+
238
+ GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
239
+ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, dataTextureId);
240
+ GLES20.glUniform1i(uDataTexture, 0);
241
+
242
+ GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
243
+ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, colormapTextureId);
244
+ GLES20.glUniform1i(uColormapTexture, 1);
245
+
246
+ GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vboId);
247
+ GLES20.glEnableVertexAttribArray(aPosition);
248
+ GLES20.glVertexAttribPointer(aPosition, 2, GLES20.GL_FLOAT, false, 16, 0);
249
+ GLES20.glEnableVertexAttribArray(aTexCoord);
250
+ GLES20.glVertexAttribPointer(aTexCoord, 2, GLES20.GL_FLOAT, false, 16, 8);
251
+ GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, iboId);
252
+
253
+ GLES20.glEnable(GLES20.GL_BLEND);
254
+ GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
255
+ GLES20.glDisable(GLES20.GL_DEPTH_TEST);
256
+
257
+ GLES20.glDrawElements(GLES20.GL_TRIANGLES, indexCount, GLES20.GL_UNSIGNED_SHORT, 0);
258
+
259
+ GLES20.glDisableVertexAttribArray(aPosition);
260
+ GLES20.glDisableVertexAttribArray(aTexCoord);
261
+ GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
262
+ GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0);
263
+ }
264
+
265
+ @Override
266
+ public void deinitialize() {
267
+ if (program != 0) { GLES20.glDeleteProgram(program); program = 0; }
268
+ int[] texturesToDelete = {dataTextureId, colormapTextureId};
269
+ GLES20.glDeleteTextures(2, texturesToDelete, 0);
270
+ dataTextureId = 0; colormapTextureId = 0;
271
+ int[] buffersToDelete = {vboId, iboId};
272
+ GLES20.glDeleteBuffers(2, buffersToDelete, 0);
273
+ vboId = 0; iboId = 0;
274
+ }
275
+
276
+ @Override
277
+ public void contextLost() {
278
+ program = 0; dataTextureId = 0; colormapTextureId = 0; vboId = 0; iboId = 0;
279
+ }
280
+
281
+ public void setOpacity(float opacity) { this.opacity = opacity; }
282
+ public void setDataRange(float[] dataRange) { this.dataRange = dataRange; }
283
+ public void setConversionType(int type) { this.conversionType = type; }
284
+ public void setSmoothing(boolean enabled) {
285
+ if (this.smoothingEnabled != enabled) {
286
+ this.smoothingEnabled = enabled;
287
+ this.textureParametersDirty = true;
288
+ }
289
+ }
290
+
291
+ // This existing method is now used by both the old JS path and our new native path
292
+ public void updateDataTexture(byte[] bytes, int nx, int ny, float scale, float offset, float missing, String scaleType) {
293
+ ByteBuffer dataBuffer = ByteBuffer.allocateDirect(bytes.length);
294
+ dataBuffer.put(bytes);
295
+ dataBuffer.position(0);
296
+ synchronized (dataLock) {
297
+ this.pendingDataBuffer = dataBuffer;
298
+ this.pendingNx = nx;
299
+ this.pendingNy = ny;
300
+ this.pendingScale = scale;
301
+ this.pendingOffset = offset;
302
+ this.pendingMissing = missing;
303
+ this.pendingScaleType = "sqrt".equals(scaleType) ? 1 : 0;
304
+ }
305
+ }
306
+
307
+ public void updateColormapTexture(ByteBuffer data) {
308
+ synchronized (dataLock) { this.pendingColormapBuffer = data; }
309
+ }
310
+
311
+ private void generateLCCGeometry(ReadableMap gridDefMap, ArrayList<Float> vertices, ArrayList<Short> indices) {
312
+ ReadableMap gridParams = gridDefMap.getMap("grid_params");
313
+ ReadableMap projParams = gridDefMap.getMap("proj_params");
314
+
315
+ if (gridParams == null || projParams == null) {
316
+ Log.e(TAG, "Missing grid or projection parameters for LCC");
317
+ return;
318
+ }
319
+
320
+ int nx = gridParams.getInt("nx");
321
+ int ny = gridParams.getInt("ny");
322
+ double dx = getDouble(gridParams, "dx", 0);
323
+ double dy = getDouble(gridParams, "dy", 0);
324
+ double x_origin = getDouble(gridParams, "x_origin", 0);
325
+ double y_origin = getDouble(gridParams, "y_origin", 0);
326
+
327
+ int subdivisions = 60;
328
+ final double TILE_SIZE = 512.0;
329
+
330
+ double x_min = x_origin;
331
+ double y_max = y_origin;
332
+ double x_max = x_origin + (nx - 1) * dx;
333
+ double y_min = y_origin + (ny - 1) * dy;
334
+
335
+ Object[][] vertexGrid = new Object[subdivisions + 1][subdivisions + 1];
336
+ int validVertexCount = 0;
337
+
338
+ for (int row = 0; row <= subdivisions; row++) {
339
+ for (int col = 0; col <= subdivisions; col++) {
340
+ double t_x = (double) col / subdivisions;
341
+ double t_y = (double) row / subdivisions;
342
+
343
+ double proj_x = x_min + t_x * (x_max - x_min);
344
+ double proj_y = y_max + t_y * (y_min - y_max);
345
+
346
+ double[] latLon = projectLCCToLatLon(proj_x, proj_y, projParams);
347
+
348
+ if (latLon == null) {
349
+ vertexGrid[row][col] = null;
350
+ continue;
351
+ }
352
+
353
+ double lon = latLon[0];
354
+ double lat = latLon[1];
355
+
356
+ double mercX_normalized = (lon + 180.0) / 360.0;
357
+ double clampedLat = Math.max(-85.05112878, Math.min(85.05112878, lat));
358
+ double sinLatitude = Math.sin(Math.toRadians(clampedLat));
359
+ double mercY_normalized = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
360
+
361
+ double mercX = mercX_normalized * TILE_SIZE;
362
+ double mercY = mercY_normalized * TILE_SIZE;
363
+
364
+ if (!Double.isFinite(mercX) || !Double.isFinite(mercY)) {
365
+ vertexGrid[row][col] = null;
366
+ continue;
367
+ }
368
+
369
+ float tex_u = (float) t_x;
370
+ float tex_v = (float) t_y;
371
+
372
+ VertexInfo vInfo = new VertexInfo();
373
+ vInfo.mercX = (float) mercX;
374
+ vInfo.mercY = (float) mercY;
375
+ vInfo.texU = tex_u;
376
+ vInfo.texV = tex_v;
377
+ vInfo.index = (short) validVertexCount;
378
+
379
+ vertexGrid[row][col] = vInfo;
380
+
381
+ vertices.add((float) mercX);
382
+ vertices.add((float) mercY);
383
+ vertices.add(tex_u);
384
+ vertices.add(tex_v);
385
+
386
+ validVertexCount++;
387
+ }
388
+ }
389
+
390
+ if (vertices.isEmpty()) {
391
+ Log.e(TAG, "No valid vertices generated for LCC grid");
392
+ return;
393
+ }
394
+
395
+ for (int row = 0; row < subdivisions; row++) {
396
+ for (int col = 0; col < subdivisions; col++) {
397
+ VertexInfo topLeft = (VertexInfo) vertexGrid[row][col];
398
+ VertexInfo topRight = (VertexInfo) vertexGrid[row][col + 1];
399
+ VertexInfo bottomLeft = (VertexInfo) vertexGrid[row + 1][col];
400
+ VertexInfo bottomRight = (VertexInfo) vertexGrid[row + 1][col + 1];
401
+
402
+ if (topLeft != null && topRight != null && bottomLeft != null && bottomRight != null) {
403
+ indices.add(topLeft.index);
404
+ indices.add(bottomLeft.index);
405
+ indices.add(topRight.index);
406
+
407
+ indices.add(topRight.index);
408
+ indices.add(bottomLeft.index);
409
+ indices.add(bottomRight.index);
410
+ }
411
+ }
412
+ }
413
+ }
414
+
415
+ private static class VertexInfo {
416
+ float mercX, mercY, texU, texV;
417
+ short index;
418
+ }
419
+
420
+ private double[] projectLCCToLatLon(double x, double y, ReadableMap projParams) {
421
+ // TODO: Implement using proj4j library
422
+ Log.w(TAG, "LCC projection conversion not yet implemented - add proj4j library");
423
+ return null;
424
+ }
425
+
426
+ private boolean isLCCType(ReadableMap gridDefMap) {
427
+ if (gridDefMap == null) return false;
428
+ ReadableMap projParams = gridDefMap.getMap("proj_params");
429
+ if (projParams == null) return false;
430
+ return projParams.hasKey("proj") && "lcc".equals(projParams.getString("proj"));
431
+ }
432
+
433
+ public void updateGeometry(ReadableMap cornersMap, ReadableMap gridDefMap) {
434
+ if (gridDefMap == null) return;
435
+ ArrayList<Float> vertices = new ArrayList<>();
436
+ ArrayList<Short> indices = new ArrayList<>();
437
+ generateGeometryData(gridDefMap, vertices, indices);
438
+ if (vertices.isEmpty() || indices.isEmpty()) {
439
+ Log.e(TAG, "Generated geometry is empty, aborting GPU buffer update.");
440
+ return;
441
+ }
442
+ FloatBuffer vb = ByteBuffer.allocateDirect(vertices.size() * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
443
+ float[] vertexArray = new float[vertices.size()];
444
+ for (int i = 0; i < vertices.size(); i++) vertexArray[i] = vertices.get(i);
445
+ vb.put(vertexArray).position(0);
446
+ ShortBuffer ib = ByteBuffer.allocateDirect(indices.size() * 2).order(ByteOrder.nativeOrder()).asShortBuffer();
447
+ short[] indexArray = new short[indices.size()];
448
+ for (int i = 0; i < indices.size(); i++) indexArray[i] = indices.get(i);
449
+ ib.put(indexArray).position(0);
450
+ synchronized (dataLock) {
451
+ pendingVertexBuffer = vb;
452
+ pendingIndexBuffer = ib;
453
+ }
454
+ }
455
+
456
+ private boolean isGFSType(ReadableMap gridParams) {
457
+ if (gridParams == null) return false;
458
+ return getDouble(gridParams, "lon_first", -1) == 0.0 &&
459
+ Math.abs(getDouble(gridParams, "lat_first", -1)) == 90.0;
460
+ }
461
+
462
+ // packages/react-native/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java
463
+
464
+ // ... (keep the rest of the file the same, only replace this one method)
465
+
466
+ private void generateGeometryData(ReadableMap gridDefMap, ArrayList<Float> vertices, ArrayList<Short> indices) {
467
+ ReadableMap gridParams = gridDefMap.getMap("grid_params");
468
+ if (gridParams == null) {
469
+ Log.e(TAG, "❌ [Geometry] grid_params is null. Aborting mesh generation.");
470
+ return;
471
+ }
472
+
473
+ // --- Path 1: Specialized GFS Global Grid Logic (Working Correctly) ---
474
+ if (isGFSType(gridParams)) {
475
+ // This proven logic remains unchanged.
476
+ int subdivisions = 120;
477
+ int verticesPerRow = (subdivisions * 3) + 1;
478
+ final double TILE_SIZE = 512.0;
479
+ for (int row = 0; row <= subdivisions; row++) {
480
+ for (int col = 0; col <= subdivisions * 3; col++) {
481
+ float v_interp = (float) row / subdivisions;
482
+ float u_interp = (float) col / subdivisions;
483
+ double lon = -540.0 + u_interp * 1080.0;
484
+ double lat = -90.0 + v_interp * 180.0;
485
+ double mercX_normalized = (lon + 180.0) / 360.0;
486
+ double clampedLat = Math.max(-85.05112878, Math.min(85.05112878, lat));
487
+ double sinLatitude = Math.sin(Math.toRadians(clampedLat));
488
+ double mercY_normalized = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
489
+ double mercX = mercX_normalized * TILE_SIZE;
490
+ double mercY = mercY_normalized * TILE_SIZE;
491
+ vertices.add((float) mercX);
492
+ vertices.add((float) mercY);
493
+ float tex_u = (float) ((lon + 180.0) / 360.0);
494
+ float tex_v = 1.0f - v_interp;
495
+ vertices.add(tex_u);
496
+ vertices.add(tex_v);
497
+ }
498
+ }
499
+ for (short row = 0; row < subdivisions; row++) {
500
+ for (short col = 0; col < subdivisions * 3; col++) {
501
+ short tl = (short) (row * verticesPerRow + col);
502
+ short tr = (short) (tl + 1);
503
+ short bl = (short) ((row + 1) * verticesPerRow + col);
504
+ short br = (short) (bl + 1);
505
+ indices.add(tl); indices.add(bl); indices.add(tr);
506
+ indices.add(tr); indices.add(bl); indices.add(br);
507
+ }
508
+ }
509
+ return;
510
+ }
511
+
512
+ // --- Path 2: LCC Grid Logic ---
513
+ if (isLCCType(gridDefMap)) {
514
+ generateLCCGeometry(gridDefMap, vertices, indices);
515
+ return;
516
+ }
517
+
518
+ // Step 1: Extract grid parameters
519
+ int nx = gridParams.getInt("nx");
520
+ int ny = gridParams.getInt("ny");
521
+ double lon_first = getDouble(gridParams, "lon_first", 0.0);
522
+ double lat_first = getDouble(gridParams, "lat_first", 90.0);
523
+ double dx = getDouble(gridParams, "dx_degrees", 0.0);
524
+ double dy = getDouble(gridParams, "dy_degrees", 0.0);
525
+ double lon_last = getDouble(gridParams, "lon_last", lon_first + (nx - 1) * dx);
526
+ double lat_last = getDouble(gridParams, "lat_last", lat_first + (ny - 1) * dy);
527
+ double lat_span = lat_last - lat_first;
528
+ boolean isSouthToNorth = lat_span > 0;
529
+
530
+ // Step 2: Normalize data longitudes to the -180 to +180 range for consistent placement.
531
+ double data_lon_first_180 = lon_first > 180 ? lon_first - 360 : lon_first;
532
+ double data_lon_last_180 = lon_last > 180 ? lon_last - 360 : lon_last;
533
+ double data_lon_range = data_lon_last_180 - data_lon_first_180;
534
+
535
+ // Step 3: Define mesh properties
536
+ int subdivisions_x = 120; // Subdivisions for a single mesh instance
537
+ int subdivisions_y = 60;
538
+ int verticesPerMesh = (subdivisions_y + 1) * (subdivisions_x + 1);
539
+ int verticesPerRow = subdivisions_x + 1;
540
+ final double TILE_SIZE = 512.0;
541
+
542
+ // Step 4: Generate three separate, non-connected meshes to prevent seam artifacts
543
+ for (int world_copy = -1; world_copy <= 1; world_copy++) {
544
+ short vertexStartIndex = (short) (vertices.size() / 4); // 4 floats per vertex (x,y,u,v)
545
+ double lon_offset = world_copy * 360.0;
546
+
547
+ // Generate vertices for this specific world copy
548
+ for (int row = 0; row <= subdivisions_y; row++) {
549
+ for (int col = 0; col <= subdivisions_x; col++) {
550
+ float v_interp = (float) row / subdivisions_y;
551
+ float u_interp = (float) col / subdivisions_x;
552
+
553
+ // Vertex position is interpolated across the data's native bounds, then offset for the world copy
554
+ double vertex_lon = data_lon_first_180 + (u_interp * data_lon_range);
555
+ double vertex_lat = lat_first + (v_interp * lat_span);
556
+
557
+ // Convert to map coordinates, adding the world copy offset
558
+ double mercX_normalized = ((vertex_lon + lon_offset) + 180.0) / 360.0;
559
+ double clampedLat = Math.max(-85.05112878, Math.min(85.05112878, vertex_lat));
560
+ double sinLatitude = Math.sin(Math.toRadians(clampedLat));
561
+ double mercY_normalized = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
562
+ double mercX = mercX_normalized * TILE_SIZE;
563
+ double mercY = mercY_normalized * TILE_SIZE;
564
+
565
+ vertices.add((float) mercX);
566
+ vertices.add((float) mercY);
567
+
568
+ // Texture coordinates are always a clean 0.0 to 1.0 for each mesh instance
569
+ float tex_u = u_interp;
570
+ float tex_v = isSouthToNorth ? (1.0f - v_interp) : v_interp;
571
+
572
+ vertices.add(tex_u);
573
+ vertices.add(tex_v);
574
+ }
575
+ }
576
+
577
+ // Generate indices for this specific world copy, offsetting by the starting index
578
+ for (short row = 0; row < subdivisions_y; row++) {
579
+ for (short col = 0; col < subdivisions_x; col++) {
580
+ short tl = (short) (vertexStartIndex + row * verticesPerRow + col);
581
+ short tr = (short) (tl + 1);
582
+ short bl = (short) (vertexStartIndex + (row + 1) * verticesPerRow + col);
583
+ short br = (short) (bl + 1);
584
+
585
+ if (isSouthToNorth) {
586
+ indices.add(tl); indices.add(bl); indices.add(tr);
587
+ indices.add(tr); indices.add(bl); indices.add(br);
588
+ } else { // North-to-South (MRMS)
589
+ indices.add(tl); indices.add(tr); indices.add(bl);
590
+ indices.add(bl); indices.add(tr); indices.add(br);
591
+ }
592
+ }
593
+ }
594
+ }
595
+ }
596
+
597
+ }