You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid retaining GeoJSONSource data on main thread #3220
GeoJSONSource retains any data set via Map#addSource(...) or GeoJSONSource#setData in a _data member. This data is included in the serialized representation of the source, but as far as I can tell, that's unnecessary: the only thing that serialized sources are used for is style validation, which does not care about GeoJSON data.
Because the data is also passed to the worker, we are effectively doubling the memory requirements of GeoJSON sources. We could avoid creating a member variable, or set it to null after sending the data to the worker, which would eliminate this overhead.
Reacted by Volodymyr Agafonkin, KoAi, Lucas Wojciechowski, Ryan Baumann and Anand Eng-Thakker
One thing we'll need to resolve is how setStyle's diff should handle GeoJSON sources. As of now, we're doing a deep equality test, which is probably not what we want (see also #4006 (comment)).
Activity
anandthakker commentedon Jan 28, 2017
One thing we'll need to resolve is how
setStyle's diff should handle GeoJSON sources. As of now, we're doing a deep equality test, which is probably not what we want (see also #4006 (comment)).