Skip to content

Commit e3f43f8

Browse files
mfazekasclaude
andauthored
feat: Add RasterParticleLayer and RasterArraySource for Mapbox v11 (#4082)
* feat: Add RasterParticleLayer and RasterArraySource for Mapbox v11 Add support for particle layer animations (wind, ocean currents, etc.) for Mapbox Maps SDK v11.4.0+. This feature requires both a new source type (RasterArraySource) and layer type (RasterParticleLayer). Changes: - Add RasterArraySource component for raster array tile data - Add RasterParticleLayer component for particle animations - Implement native iOS support (old + new architecture) - Implement native Android support (old + new architecture) - Add TypeScript specs for both components - Export new components in Mapbox.native.ts Features: - Supports velocity-based particle animations - Paint properties: raster-particle-speed-factor, raster-particle-count, raster-particle-color, raster-particle-max-speed, etc. - Marked as experimental (matches Mapbox SDK) - Requires Mapbox v11.4.0+ on both platforms - New architecture (Fabric) support included Note: Run 'yarn generate' to generate style types and native setters * docs: Add wind particle animation example for RasterParticleLayer Add a comprehensive example demonstrating the new RasterParticleLayer and RasterArraySource components. The example visualizes wind patterns across the United States using particle animations. Changes: - Add RasterParticle.tsx example in V11 directory - Configure particle properties (speed, count, color gradient) - Add detailed documentation about the feature - Register example in GroupAndItem.tsx navigation Features demonstrated: - RasterArraySource with Mapbox wind data - RasterParticleLayer with customized styling - Dynamic color gradient based on particle speed - Particle count, fade, and reset rate configuration * fix: Add TypeScript types and style mappings for RasterParticleLayer Add manual type definitions and style mappings for RasterParticleLayer since yarn generate cannot be run without dependencies. Changes: - Update generateCodeWithEjs.mjs to support v11-only layers - Add RasterParticleLayerStyleProps to MapboxStyles.ts - Add raster-particle style properties to styleMap.ts - Include all particle properties: count, color, speed, fade, etc. This fixes the "rasterParticleSpeedFactor is not a valid Mapbox layer style" error. Note: When yarn install is run, developers should run 'yarn generate' to regenerate these files from the style-spec v8.json templates. * remove test file * fix: Add autogenerate support for RasterParticleLayer and new v11 layers - Fix getSupportedProperties to handle layers without paint/layout attributes - Add layer type mappings for raster-particle, slot, and clip layers - Generate native code and docs for RasterParticleLayer and RasterArraySource - Generate old-arch Java files for new components - Update TypeScript types and style mappings This fixes the yarn generate script which was broken due to new Mapbox v11 layers (slot, clip, raster-particle) that have different attribute structures than traditional layers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Add raster-particle-speed to ExpressionParameters and fix lint issues - Add 'raster-particle-speed' to ExpressionParameters type for particle layer color expressions - Remove unused React import from RasterParticle example - Auto-fix prettier formatting issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: Add RasterParticleLayer and RasterArraySource to interface test Update the public interface test to include the new RasterParticleLayer and RasterArraySource exports. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Fix Swift template generation for layers without properties The template was generating invalid Swift code for layers that have no properties (like 'slot' which has no paint or layout properties). Changes: - Add check for layer.properties.length > 0 before generating if-else chain - For layers with no properties, directly output error message - Add 'raster-particle-speed' to ExpressionParameters in MapboxStyles template - Regenerate all files with fixed templates This fixes the Swift syntax error: "extraneous '}' at top level" and "consecutive statements on a line must be separated by ';'" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Exclude rasterParticleElevation and fix clipLayerTypes array handling Two iOS compilation errors fixed: 1. rasterParticleElevation property: - Added to UnsupportedProperties list - Style spec says it's available in iOS 11.7.0 - Not actually implemented in Mapbox Maps SDK yet - Removed from generated code until SDK implements it 2. clipLayerTypes array of enum handling: - Fixed template to use mglStyleValueArrayString() for enum arrays - Only textWritingMode and textVariableAnchor need custom array methods - Other enum arrays use generic string array method Changes: - Add 'raster-particle-elevation' to UnsupportedProperties list - Update Swift template to handle enum arrays properly - Regenerate all native code files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Add @_spi(Experimental) import for RasterParticleLayer and RasterArraySource Both RasterParticleLayer and RasterArraySource are experimental APIs in Mapbox Maps SDK v11. They require the @_spi(Experimental) import annotation to access these experimental features. This fixes the iOS compilation error: "Cannot find type 'RasterParticleLayer' in scope" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Remove unsupported tileSize and bounds setters for iOS RasterArraySource The Mapbox Maps SDK for iOS marks tileSize and bounds as read-only properties (public private(set)) in RasterArraySource. These properties can only be: - Derived from TileJSON when using url - Set during source construction (not available in current API) Changes: - Remove attempts to set tileSize and bounds after source creation on iOS - Add detailed comments explaining the limitation - Update TypeScript documentation with @platform android annotation - Suggest using TileJSON for custom values on iOS Android implementation continues to work as both properties are settable through the Builder pattern. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Implement mglStyleValueArrayClipLayerTypes for iOS ClipLayer Add proper type conversion for clipLayerTypes property which expects Value<[ClipLayerTypes]> instead of Value<[String]>. Changes: - Add mglStyleValueArrayClipLayerTypes() method in RNMBXStyleValue.swift - Converts string array to ClipLayerTypes enum array (model, symbol) - Follows same pattern as textWritingMode and textVariableAnchor - Update template to use custom method for clipLayerTypes enum array - Regenerate RNMBXStyle.swift with correct type conversion This fixes the iOS compilation error: "Cannot assign value of type 'Value<[String]>' to type 'Value<[ClipLayerTypes]>'" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Complete RasterParticleLayer and RasterArraySource implementation Fixes for code generation and Android/iOS compilation: - Fixed code generation to handle layers without properties (slot, clip) - Excluded slot and clip layers from generation (no RN components yet) - Added RasterParticleLayer and RasterArraySource to Android package registration - Added getLong() method to RNMBXStyleValue for rasterParticleCount - Added special handling for rasterParticleColor (uses getIntExpression) - Added special handling for rasterParticleCount (Long type) - Added raster-particle-speed to ExpressionParameters type - Updated example documentation about MRT tileset requirements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * build on v10 * fix build * genereate * fix: v10 compatibility for RasterParticleLayer and RasterArraySource - Restore RasterParticleLayer.kt v10 stub file - Remove TileSet reference from RasterArraySource.kt v10 stub (not available in v10) - Regenerate iOS code with proper #if RNMBX_11 guards for RasterParticleLayer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: v10 compatibility for RasterParticleLayer and RasterArraySource --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 97a2342 commit e3f43f8

File tree

63 files changed

+7116
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+7116
-341
lines changed

__tests__/interface.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('Public Interface', () => {
3838
'SymbolLayer',
3939
'BackgroundLayer',
4040
'RasterLayer',
41+
'RasterParticleLayer',
4142
'SkyLayer',
4243
'Terrain',
4344
'Atmosphere',
@@ -46,6 +47,7 @@ describe('Public Interface', () => {
4647
'VectorSource',
4748
'ShapeSource',
4849
'RasterSource',
50+
'RasterArraySource',
4951
'ImageSource',
5052
'RasterDemSource',
5153
'Images',

android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ import com.rnmapbox.rnmbx.components.styles.layers.RNMBXHeatmapLayerManager
3434
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXLineLayerManager
3535
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXModelLayerManager
3636
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXRasterLayerManager
37+
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXRasterParticleLayerManager
3738
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXSkyLayerManager
3839
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXSymbolLayerManager
3940
import com.rnmapbox.rnmbx.components.styles.light.RNMBXLightManager
4041
import com.rnmapbox.rnmbx.components.styles.model.RNMBXModelsManager
4142
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXImageSourceManager
43+
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXRasterArraySourceManager
4244
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXRasterDemSourceManager
4345
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXRasterSourceManager
4446
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXShapeSourceManager
@@ -140,6 +142,9 @@ class RNMBXPackage : TurboReactPackage() {
140142
))
141143
managers.add(RNMBXRasterDemSourceManager(reactApplicationContext))
142144
managers.add(RNMBXRasterSourceManager(reactApplicationContext))
145+
if (RNMBXRasterArraySourceManager.isImplemented) {
146+
managers.add(RNMBXRasterArraySourceManager(reactApplicationContext))
147+
}
143148
managers.add(RNMBXImageSourceManager())
144149

145150
// images
@@ -154,6 +159,9 @@ class RNMBXPackage : TurboReactPackage() {
154159
managers.add(RNMBXCircleLayerManager())
155160
managers.add(RNMBXSymbolLayerManager())
156161
managers.add(RNMBXRasterLayerManager())
162+
if (RNMBXRasterParticleLayerManager.isImplemented) {
163+
managers.add(RNMBXRasterParticleLayerManager())
164+
}
157165
managers.add(RNMBXSkyLayerManager())
158166
managers.add(RNMBXTerrainManager())
159167
managers.add(RNMBXAtmosphereManager())

android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.mapbox.maps.extension.style.layers.generated.SkyLayer
1313
// import com.mapbox.maps.extension.style.layers.generated.PropertyFactory
1414
// import com.mapbox.maps.extension.style.layers.generated.PropertyValue
1515
import com.mapbox.maps.extension.style.layers.generated.RasterLayer
16+
import com.mapbox.maps.extension.style.layers.generated.RasterParticleLayer
1617
import com.mapbox.maps.extension.style.layers.generated.SymbolLayer
1718
import com.mapbox.maps.extension.style.layers.generated.HeatmapLayer
1819
import com.mapbox.maps.extension.style.layers.generated.HillshadeLayer
@@ -704,6 +705,44 @@ object RNMBXStyleFactory {
704705
}
705706
}
706707
}
708+
fun setRasterParticleLayerStyle(layer: RasterParticleLayer, style: RNMBXStyle ) {
709+
val styleKeys = style.allStyleKeys
710+
711+
if (styleKeys.isEmpty()) {
712+
return
713+
}
714+
715+
for (styleKey in styleKeys) {
716+
try {
717+
val styleValue = style.getStyleValueForKey(styleKey)
718+
719+
when (styleKey) {
720+
"visibility" ->
721+
setVisibility(layer, styleValue)
722+
"rasterParticleArrayBand" ->
723+
setRasterParticleArrayBand(layer, styleValue)
724+
"rasterParticleCount" ->
725+
setRasterParticleCount(layer, styleValue)
726+
"rasterParticleColor" ->
727+
setRasterParticleColor(layer, styleValue)
728+
"rasterParticleMaxSpeed" ->
729+
setRasterParticleMaxSpeed(layer, styleValue)
730+
"rasterParticleSpeedFactor" ->
731+
setRasterParticleSpeedFactor(layer, styleValue)
732+
"rasterParticleSpeedFactorTransition" ->
733+
setRasterParticleSpeedFactorTransition(layer, styleValue)
734+
"rasterParticleFadeOpacityFactor" ->
735+
setRasterParticleFadeOpacityFactor(layer, styleValue)
736+
"rasterParticleFadeOpacityFactorTransition" ->
737+
setRasterParticleFadeOpacityFactorTransition(layer, styleValue)
738+
"rasterParticleResetRateFactor" ->
739+
setRasterParticleResetRateFactor(layer, styleValue)
740+
}
741+
} catch (e: MapboxStyleException) {
742+
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
743+
}
744+
}
745+
}
707746
fun setHillshadeLayerStyle(layer: HillshadeLayer, style: RNMBXStyle ) {
708747
val styleKeys = style.allStyleKeys
709748

@@ -4354,6 +4393,147 @@ object RNMBXStyleFactory {
43544393
}
43554394
}
43564395

4396+
fun setVisibility(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4397+
layer.visibility(Visibility.valueOf(styleValue.getEnumName()));
4398+
}
4399+
4400+
fun setRasterParticleArrayBand(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4401+
if (styleValue.isExpression()) {
4402+
val expression = styleValue.getExpression()
4403+
if (expression != null) {
4404+
layer.rasterParticleArrayBand(expression)
4405+
} else {
4406+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleArrayBand is null")
4407+
}
4408+
} else {
4409+
val value = styleValue.getString(VALUE_KEY)
4410+
if (value != null) {
4411+
layer.rasterParticleArrayBand(value)
4412+
} else {
4413+
Logger.e("RNMBXRasterParticle", "value for rasterParticleArrayBand is null")
4414+
}
4415+
}
4416+
}
4417+
4418+
fun setRasterParticleCount(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4419+
if (styleValue.isExpression()) {
4420+
val expression = styleValue.getExpression()
4421+
if (expression != null) {
4422+
layer.rasterParticleCount(expression)
4423+
} else {
4424+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleCount is null")
4425+
}
4426+
} else {
4427+
val value = styleValue.getLong(VALUE_KEY)
4428+
if (value != null) {
4429+
layer.rasterParticleCount(value)
4430+
} else {
4431+
Logger.e("RNMBXRasterParticle", "value for rasterParticleCount is null")
4432+
}
4433+
}
4434+
}
4435+
4436+
fun setRasterParticleColor(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4437+
if (styleValue.isExpression()) {
4438+
val expression = styleValue.getExpression()
4439+
if (expression != null) {
4440+
layer.rasterParticleColor(expression)
4441+
} else {
4442+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleColor is null")
4443+
}
4444+
} else {
4445+
layer.rasterParticleColor(styleValue.getIntExpression(VALUE_KEY))
4446+
}
4447+
}
4448+
4449+
fun setRasterParticleMaxSpeed(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4450+
if (styleValue.isExpression()) {
4451+
val expression = styleValue.getExpression()
4452+
if (expression != null) {
4453+
layer.rasterParticleMaxSpeed(expression)
4454+
} else {
4455+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleMaxSpeed is null")
4456+
}
4457+
} else {
4458+
val value = styleValue.getDouble(VALUE_KEY)
4459+
if (value != null) {
4460+
layer.rasterParticleMaxSpeed(value)
4461+
} else {
4462+
Logger.e("RNMBXRasterParticle", "value for rasterParticleMaxSpeed is null")
4463+
}
4464+
}
4465+
}
4466+
4467+
fun setRasterParticleSpeedFactor(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4468+
if (styleValue.isExpression()) {
4469+
val expression = styleValue.getExpression()
4470+
if (expression != null) {
4471+
layer.rasterParticleSpeedFactor(expression)
4472+
} else {
4473+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleSpeedFactor is null")
4474+
}
4475+
} else {
4476+
val value = styleValue.getDouble(VALUE_KEY)
4477+
if (value != null) {
4478+
layer.rasterParticleSpeedFactor(value)
4479+
} else {
4480+
Logger.e("RNMBXRasterParticle", "value for rasterParticleSpeedFactor is null")
4481+
}
4482+
}
4483+
}
4484+
4485+
4486+
fun setRasterParticleSpeedFactorTransition(layer: RasterParticleLayer, styleValue: RNMBXStyleValue) {
4487+
val transition = styleValue.transition
4488+
if (transition != null) {
4489+
layer.rasterParticleSpeedFactorTransition(transition);
4490+
}
4491+
}
4492+
4493+
fun setRasterParticleFadeOpacityFactor(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4494+
if (styleValue.isExpression()) {
4495+
val expression = styleValue.getExpression()
4496+
if (expression != null) {
4497+
layer.rasterParticleFadeOpacityFactor(expression)
4498+
} else {
4499+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleFadeOpacityFactor is null")
4500+
}
4501+
} else {
4502+
val value = styleValue.getDouble(VALUE_KEY)
4503+
if (value != null) {
4504+
layer.rasterParticleFadeOpacityFactor(value)
4505+
} else {
4506+
Logger.e("RNMBXRasterParticle", "value for rasterParticleFadeOpacityFactor is null")
4507+
}
4508+
}
4509+
}
4510+
4511+
4512+
fun setRasterParticleFadeOpacityFactorTransition(layer: RasterParticleLayer, styleValue: RNMBXStyleValue) {
4513+
val transition = styleValue.transition
4514+
if (transition != null) {
4515+
layer.rasterParticleFadeOpacityFactorTransition(transition);
4516+
}
4517+
}
4518+
4519+
fun setRasterParticleResetRateFactor(layer: RasterParticleLayer, styleValue: RNMBXStyleValue ) {
4520+
if (styleValue.isExpression()) {
4521+
val expression = styleValue.getExpression()
4522+
if (expression != null) {
4523+
layer.rasterParticleResetRateFactor(expression)
4524+
} else {
4525+
Logger.e("RNMBXRasterParticle", "Expression for rasterParticleResetRateFactor is null")
4526+
}
4527+
} else {
4528+
val value = styleValue.getDouble(VALUE_KEY)
4529+
if (value != null) {
4530+
layer.rasterParticleResetRateFactor(value)
4531+
} else {
4532+
Logger.e("RNMBXRasterParticle", "value for rasterParticleResetRateFactor is null")
4533+
}
4534+
}
4535+
}
4536+
43574537
fun setVisibility(layer: HillshadeLayer, styleValue: RNMBXStyleValue ) {
43584538
layer.visibility(Visibility.valueOf(styleValue.getEnumName()));
43594539
}

android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class RNMBXStyleValue(key: String?, config: ReadableMap) {
3333
return mPayload!!.getInt(key!!)
3434
}
3535

36+
fun getLong(key: String?): Long {
37+
return mPayload!!.getInt(key!!).toLong()
38+
}
39+
3640
fun getIntExpression(key: String?): Expression {
3741
return Expression.literal(mPayload!!.getInt(key!!).toLong())
3842
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Dummy RasterParticleLayer for v10 compatibility
2+
// RasterParticleLayer is only available in Mapbox SDK v11+
3+
package com.mapbox.maps.extension.style.layers.generated
4+
5+
import com.mapbox.maps.extension.style.expressions.generated.Expression
6+
import com.mapbox.maps.extension.style.layers.properties.generated.Visibility
7+
import com.mapbox.maps.extension.style.types.StyleTransition
8+
9+
/**
10+
* Dummy implementation of RasterParticleLayer for v10 compatibility.
11+
* This class should never be instantiated in v10 builds.
12+
* Note: Does not extend Layer to avoid abstract method issues in v10.
13+
*/
14+
class RasterParticleLayer(private val id: String, private val sourceId: String) {
15+
16+
val layerId: String
17+
get() = id
18+
19+
var minZoom: Double? = null
20+
private set
21+
22+
var maxZoom: Double? = null
23+
private set
24+
25+
var visibility: Visibility? = null
26+
private set
27+
28+
fun minZoom(minZoom: Double): RasterParticleLayer {
29+
this.minZoom = minZoom
30+
return this
31+
}
32+
33+
fun maxZoom(maxZoom: Double): RasterParticleLayer {
34+
this.maxZoom = maxZoom
35+
return this
36+
}
37+
38+
fun getType(): String = "raster-particle"
39+
40+
fun rasterParticleArrayBand(value: String) {}
41+
fun rasterParticleArrayBand(expression: Expression) {}
42+
fun rasterParticleCount(value: Long) {}
43+
fun rasterParticleCount(expression: Expression) {}
44+
fun rasterParticleColor(expression: Expression) {}
45+
fun rasterParticleMaxSpeed(value: Double) {}
46+
fun rasterParticleMaxSpeed(expression: Expression) {}
47+
fun rasterParticleSpeedFactor(value: Double) {}
48+
fun rasterParticleSpeedFactor(expression: Expression) {}
49+
fun rasterParticleSpeedFactorTransition(transition: StyleTransition) {}
50+
fun rasterParticleFadeOpacityFactor(value: Double) {}
51+
fun rasterParticleFadeOpacityFactor(expression: Expression) {}
52+
fun rasterParticleFadeOpacityFactorTransition(transition: StyleTransition) {}
53+
fun rasterParticleResetRateFactor(value: Double) {}
54+
fun rasterParticleResetRateFactor(expression: Expression) {}
55+
fun visibility(visibility: Visibility) {
56+
this.visibility = visibility
57+
}
58+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Dummy RasterArraySource for v10 compatibility
2+
// RasterArraySource is only available in Mapbox SDK v11+
3+
package com.mapbox.maps.extension.style.sources.generated
4+
5+
/**
6+
* Dummy implementation of RasterArraySource for v10 compatibility.
7+
* This class should never be instantiated in v10 builds.
8+
* Note: Does not extend Source to avoid abstract method issues in v10.
9+
*/
10+
class RasterArraySource private constructor(
11+
builder: Builder
12+
) {
13+
val sourceId: String = builder.sourceId
14+
15+
class Builder(val sourceId: String) {
16+
fun url(url: String): Builder = this
17+
fun tileSize(tileSize: Long): Builder = this
18+
fun build(): RasterArraySource = RasterArraySource(this)
19+
}
20+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.rnmapbox.rnmbx.components.styles.layers
2+
3+
import android.content.Context
4+
import android.view.ViewGroup
5+
6+
/**
7+
* Dummy implementation of RNMBXRasterParticleLayer for v10 compatibility.
8+
* This class extends ViewGroup directly (instead of RNMBXLayer) to avoid
9+
* inheriting from Layer which has internal abstract methods in v10.
10+
* This class should never be instantiated in v10 builds.
11+
*/
12+
class RNMBXRasterParticleLayer(context: Context) : ViewGroup(context) {
13+
var mSourceLayerID: String? = null
14+
15+
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
16+
// Stub - never called
17+
}
18+
19+
fun setSourceLayerID(sourceLayer: String?) {
20+
mSourceLayerID = sourceLayer
21+
}
22+
}

0 commit comments

Comments
 (0)