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 }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
Version 6.2 now enforces setGeoJson(...) to be called from the main thread.
I understand based on previous discussions that these operations should not be run from the background thread and that rendering large maps blocks the main thread is a known issue.
What would be your recommended approach for projects that are already using background thread to call setGeoJson(...) to workaround the performance issue going forward? Thanks.
The text was updated successfully, but these errors were encountered:
Thank for reaching out @ychescale9 , updating a GeoJsonSource from a worker thread is not supported and can result in crashes. As flagged, we are aware of the performance around this and will be tackling it as part of #8484.
If you need to dynamically change the underlying geometry of a source with calculating that geometry on a workerthread. You can do this with a CustomGeometrySource and the GeometryTileProvider. The latter component will be executed on a worker thread:
/** * Interface that defines methods for working with {@link CustomGeometrySource}. */publicinterfaceGeometryTileProvider {
/*** * Interface method called by {@link CustomGeometrySource} to request features for a tile. * * @param bounds {@link LatLngBounds} of the tile. * @param zoomLevel Tile zoom level. * @return Return a @{link FeatureCollection} to be displayed in the requested tile. */@WorkerThreadFeatureCollectiongetFeaturesForBounds(LatLngBoundsbounds, intzoomLevel);
}
Closing this issue, follow up will happen in #8484.
Let us know if you have any follow questions!
Platform: Android
Mapbox SDK version: android-v6.2.0-beta.1
Version 6.2 now enforces
setGeoJson(...)
to be called from the main thread.I understand based on previous discussions that these operations should not be run from the background thread and that rendering large maps blocks the main thread is a known issue.
What would be your recommended approach for projects that are already using background thread to call
setGeoJson(...)
to workaround the performance issue going forward? Thanks.The text was updated successfully, but these errors were encountered: