This PR fixes the race condition when updating LocationCompoent's position.
This PR also adds documentation to the GeoJsonSource#setGeoJson, stating the method is not thread-safe.
When using SymbolLayer and GeoJsonSource backed location puck, there's high frequency
modifications done on the main thread and locationFeature is always re-used (modified)
while being parsed on the worker thread. As the GeoJsonSource#setGeoJson method is not thread-safe,
we should do a deep copy of the location feature before passing setting it to GeoJsonSource.
<changelog>Fix the race condition when updating LocationCompoent's position.</changelog>
This PR fixes the race condition when updating LocationCompoent's position. This PR also adds documentation to the
GeoJsonSource#setGeoJson
, stating the method is not thread-safe.When using SymbolLayer and GeoJsonSource backed location puck, there's high frequency modifications done on the main thread and locationFeature is always re-used (modified) while being parsed on the worker thread. As the
GeoJsonSource#setGeoJson
method is not thread-safe, we should do a deep copy of the location feature before passing setting it to GeoJsonSource.<changelog>Fix the race condition when updating LocationCompoent's position.</changelog>