A little background: I'm building an app that requires layer management. I'm trying to add and remove layers from the map using switches and toggles.
My strategy has been to hold a mapStyle object in the redux state, then use redux actions and reducers to add/remove layers and then pass the whole mapstyle into my map as a prop like this:
<ReactMapGL id='appMap' mapStyle={mapStyle} />
My thought was that ReactMapGL would detect the differences and just pass them on to MapBoxGL but when I modify the mapStyle I'm seeing the entire map and all its layers reload which is time-consuming and very distracting.
In the browser console I get the error:
Unable to perform style diff: Unimplemented: setLayerProperty, setLayerProperty..
Rebuilding the style from scratch.
So I can't help but wonder if I should be modifying the style some other way. Has anyone found a way around this?
_Note: I think this may related to #116 but I'm not 100% sure_
@MattReimer Is your mapStyle an Immutable map? If not, can you give it a try?
@MattReimer Were you able to solve this issue? We're experiencing the same thing currently and we are using Immutable.
Same as well!
Most helpful comment
@MattReimer Is your mapStyle an
Immutablemap? If not, can you give it a try?116 is something we are still working on.