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.
This is an Android issue but I have a proposal for all platforms for the best long-term solution.
In Android we start with an empty GeoJsonSource (Why is this not a ShapeSource like iOS?) As the user pans the map, API requests fetch new GeoJSON to add to this source.
In Android, we are running into an issue where we have manage a JSONObject which API responses get merged to. Eventually we will get a TransactiontooLargeException triggered during a screen rotation onResume() "where it pulls the parcel from onSaveInstance()"
In iOS, we don't have to manage a global object because it is possible to extract the shape source's data live, modify it, and set it to the new object, then memory is then released.
For parity in Android we need a getGeoJSON function.
Or, the better yet, it would be best if all platforms had anappendGeoJSON()/appendShape function
//current...
if let newData =mergeGeoJSONfeatures(old:self.campsiteData?.shape?.geoJSONData(usingEncoding:String.Encoding.utf8.rawValue), new: APIresponse){
if let shape =try?MGLShape(data: newData, encoding:String.Encoding.utf8.rawValue){DispatchQueue.main.async{self.campsiteData?.shape = shape
}}}//proposed
if let newShapes =try?MGLShape(data: APIresponse, encoding:String.Encoding.utf8.rawValue){DispatchQueue.main.async{self.campsiteData?.appendShapes = newShapes
}}
It would be best managed at the C++/SDK level for best performance and memory management.
The text was updated successfully, but these errors were encountered:
Please find a better name for this title!
This is an Android issue but I have a proposal for all platforms for the best long-term solution.
In Android we start with an empty
GeoJsonSource
(Why is this not aShapeSource
like iOS?) As the user pans the map, API requests fetch new GeoJSON to add to this source.In Android, we are running into an issue where we have manage a
JSONObject
which API responses get merged to. Eventually we will get aTransactiontooLargeException
triggered during a screen rotationonResume()
"where it pulls the parcel fromonSaveInstance()
"In iOS, we don't have to manage a global object because it is possible to extract the shape source's data live, modify it, and set it to the new object, then memory is then released.
For parity in Android we need a
getGeoJSON
function.Or, the better yet, it would be best if all platforms had an
appendGeoJSON()
/appendShape
functionAndroid
iOS
It would be best managed at the C++/SDK level for best performance and memory management.
The text was updated successfully, but these errors were encountered: