Skip to content

Commit

Permalink
fix(android): keep layer reference when reordering (#3577)
Browse files Browse the repository at this point in the history
  • Loading branch information
grantsisson authored Aug 10, 2024
1 parent 554a24f commit 22155a1
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 22155a1

Please sign in to comment.