Skip to content

Commit

Permalink
fix(android): keep layer reference when reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
grantsisson committed Jul 29, 2024
1 parent 0c37ee8 commit eb65b04
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ abstract class RNMBXLayer<T : Layer?>(protected var mContext: Context) : Abstrac
val layer = mLayer
if (layer != null) {
it.removeStyleLayer(layer.layerId)
mLayer = null // see https://github.com/rnmapbox/maps/pull/3392
if (reason != RemovalReason.REORDER) {
mLayer = null // see https://github.com/rnmapbox/maps/pull/3392
}
} else {
Logger.e("RNMBXLayer","mLayer is null on removal layer from map")
}
Expand Down

0 comments on commit eb65b04

Please sign in to comment.