Proposal: Moving Layer filter from props into style
#3253
MichaelDanielTom
started this conversation in
General
Replies: 1 comment 1 reply
|
@MichaelDanielTom thanks much for looking into it. I'd prefer opening a bug with a component to reproduce and do the discussion there on how to fix this. So right now Lines 1202 to 1222 in ed18ecd https://docs.mapbox.com/help/glossary/layout-paint-property/ For me moving filter to style is an API/interface question. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In
SymbolLayer,ModelLayer, etc. there exists a filter property that takes an expression. In v11, it is required that you updatefilteronLayer.swiftfrom MapboxMaps within anupdateLayerclosure, As seen in this example otherwise it does nothing. Currently, setting thefilterprop on any layer in rnmapbox doesn't do anything because there's no code that sets it inRNMBXLayer.swiftwhen RNMBX_11 is true, but even if we do set it here after parsing the json and converting to an expression, it still doesn't update.We already have the infra for diffing changes and doing everything in the
updateLayerclosure when changing the style, so why not add it there? From an initial test it does seem to work well in there, and we don't have to have an extra updateLayer closure inRNMBXLayer.swift, which could possibly lead to two updateLayer's per render.Additionally, the base
Layer.swiftdoesn't have filter in it, and same with the Android equivalent, so it's not something that applies to every layer likeminZoom,maxZoom,slot, etc. have.What do you all think? @mfazekas
All reactions