mapbox / mapbox/mapbox-maps-flutter
[performance] CameraForCoordinateBounds deprecation question
Nessuno ha ancora preso questa issue.
- Lingua principale
- Dart
- Stelle
- 380
- Fork
- 204
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Explanation
In native SDK, since 11.4.0, cameraForCoordinateBounds has been deprecated in favor of cameraForCoordinates.
In our app we are drawing some routes and users have the ability to open and close some filters etc. When those filters are opened or closed we need to move the camera to make the whole route visible since the filters hide certain areas of the map. The problem is that the replacement function cameraForCoordinates, when used from Flutter side has a significant performance penalty when compared to manually calculating bounds for the route on the Flutter side and passing only the bounds for cameraForCoordinateBounds.
Observation
The tests were done in release mode.
We have checked that for a route consisting of 14000 points, both manually calculating the bounds and getting the camera with cameraForCoordinateBounds takes approximately 5ms to complete.
When using cameraForCoordinates, we are passing those 14000 points to the native side and we need approximately 200ms to get the camera.
We assume this is not the problem for the native apps, since there is no copy of the points, but for Flutter, this causes significant performance penalty.
We had some ideas for handling it, like for example, getting the cameras for every possibility of opened filters and store them in some local variables to avoid calculation every time the state of the filters change but it doesn't seem like the right way to go about this.
Question
Since it is only a matter of time when cameraForCoordinateBounds will be removed, are there any other ideas for calculating camera for certain points without such a great performance penalty?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando l’uso di cameraForCoordinates e cameraForCoordinateBounds lato Flutter, insieme al contesto di deprecazione dell’SDK nativo. Riproduci il confronto in modalità release usando il percorso segnalato da 14.000 punti; l’issue richiede un’alternativa definita o indicazioni documentate prima che l’ambito dell’implementazione sia chiaro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- dart, flutter
- Ambito
- mobile, performance
- Tipo di issue
- Bug
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100