React-map-gl: Unable to perform style diff: Rebuilding the style from scratch

Created on 7 Apr 2018  路  3Comments  路  Source: visgl/react-map-gl

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_

Most helpful comment

@MattReimer Is your mapStyle an Immutable map? If not, can you give it a try?

116 is something we are still working on.

All 3 comments

@MattReimer Is your mapStyle an Immutable map? If not, can you give it a try?

116 is something we are still working on.

@MattReimer Were you able to solve this issue? We're experiencing the same thing currently and we are using Immutable.

Same as well!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomrussell picture tomrussell  路  5Comments

SethHamilton picture SethHamilton  路  3Comments

yangshun picture yangshun  路  4Comments

Majaspic picture Majaspic  路  4Comments

nip10 picture nip10  路  4Comments