Commit 80eb158
authored
feat: add Snow and Rain particle effect components (#4179)
* feat: add Snow and Rain particle effect components
Implements <Snow /> and <Rain /> components backed by Mapbox Maps SDK
v11.9+ experimental precipitation APIs (@_spi(Experimental)).
- Add snow/rain to the code generator (generateCodeWithEjs.mjs, globals.mjs)
- Generate SnowLayerStyleProps / RainLayerStyleProps TypeScript types
- Add RNMBXSnow / RNMBXRain iOS singleton layer implementations
- Add RNMBXSnow / RNMBXRain Fabric component views (iOS)
- Add RNMBXSnow / RNMBXRain Android implementations + managers
- Register components in RNMBXPackage and package.json codegenConfig
- Export Snow and Rain from src/Mapbox.native.ts
- Add SnowAndRain example (V11) and integrate into TerrainSkyAtmosphere
- Bump Mapbox SDK iOS + Android to 11.20.1
- Work around MapContentReconciler reset of rain by async re-applying
after initial style load completes
* fix: set explicit Rain color/vignetteColor to avoid measure-light expression errors
The default color and vignetteColor for Rain use measure-light(brightness)
expressions which fail with 'Brightness is unavailable in the current
evaluation context' in terrain/atmosphere map styles. Set explicit static
colors to bypass the failing expressions.
* docs: note measure-light limitation in Rain component JSDoc
* fix: use Standard style in TerrainSkyAtmosphere so Rain measure-light works natively
* fix: deduplicate shared property names in styleMap.ts, add precommit script
* fix: add Snow and Rain to public interface test
* chore: regenerate generated files (new style spec properties)
* fix: correct Snow/Rain import paths and remove unsupported rasterElevationReference
Fix Android build by using precipitations.generated package path for
Snow/Rain. Remove rasterElevationReference (not in SDK 11.20.1 despite
spec claiming 11.19.0). Add measure-light availability warning to Rain.
* fix: use getStyleLights() method instead of styleLights property1 parent fa0be11 commit 80eb158
35 files changed
Lines changed: 2285 additions & 34 deletions
File tree
- __tests__
- android/src/main/java/com/rnmapbox/rnmbx
- components/styles
- rain
- snow
- docs
- example/src
- examples
- V10
- V11
- scenes
- ios/RNMBX
- plugin
- scripts
- autogenHelpers
- templates
- src
- components
- specs
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
0 commit comments