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. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In
SymbolLayer
,ModelLayer
, etc. there exists a filter property that takes an expression. In v11, it is required that you updatefilter
onLayer.swift
from MapboxMaps within anupdateLayer
closure, As seen in this example otherwise it does nothing. Currently, setting thefilter
prop on any layer in rnmapbox doesn't do anything because there's no code that sets it inRNMBXLayer.swift
when 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
updateLayer
closure 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.swift
doesn'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
Beta Was this translation helpful? Give feedback.
All reactions