Comments (11)
Hi thanks for asking. Have you tried the latest version which has improved performance over prior versions? If so, what do you think - is it good enough for the tablets you're targeting?
You may be interested to hear that this plugin uses isolates, but not if the app is running in debug mode - so you'll want to test it using release mode on a real device to understand what it will be like for users. Also the theme can make a difference, so consider experimenting with different themes.
I am down to try and help finding ways to improve performance, either on your repo or on a fork.
Any contributions are most welcome!
Do you have any ressources, blogs, lines of code pointing to where you think there is improvement possible ?
The best place to start is running the example application with the profiler. I use the command:
flutter run --profile --no-dds
You'll need to run the example app on an actual device (not in a simulator)
There are some great tips on performance profiling here: https://docs.flutter.dev/perf
The biggest bottleneck at the moment is text layout. I have some ideas that I'm working on to reduce jank due to text layout.
There are likely other opportunities to improve performance which you'll be able to identify with the profiler. Ideas and PRs are welcome.
from flutter-vector-map-tiles.
I am using a samsung tab s6 lite, and the performance is quite poor. That's why we're looking to improve it.
Alright thanks for all the informations, some folks and I are gonna look into it and come back here to report any news :D
from flutter-vector-map-tiles.
I think the layout of text elements will always be a big performance problem, until there are some decent improvements inside the flutter framework. It's just extremely slow and old devices will suffer a lot, even with optimized caching and all.
Are poly-lines already getting simplified using e.g. https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm?
Edit: I read some specs, and it turns out a simplification is done by the tile-server converting to tile coords: https://docs.mapbox.com/data/tilesets/guides/vector-tiles-standards/#simplification I don't think it's wise to do another simplification...
from flutter-vector-map-tiles.
@FaFre you're right, text rendering is quite expensive. The latest release of this library (1.5.0) improves how text layout is computed by spreading the work over multiple frames. In my testing this has reduced jank significantly.
The map theme has a big effect on performance. There are a few tips in this comment on designing a map style to improve rendering fame rate.
The profiler can shed insight into which map features are creating the most overhead.
from flutter-vector-map-tiles.
That's really cool, also the TextApproximation
is very nifty. I really enjoyed reading some of the code. I will replace my raster layer with your plugin and see if I'm able to contribute some ideas or code.
I could not resist to see what happens, when I take my simplification algo from my other project (where I use it before polygon painting), and put the optimization to very aggressive.
This is is the optimized version, that simplifies with a tolerance of 50 inside the tile coord system right after decoding:
https://user-images.githubusercontent.com/59543085/166553033-742a0730-902b-4738-b3a3-eea6f7623ba7.mp4
This is the same example code, but without the optimization:
https://user-images.githubusercontent.com/59543085/166553300-b8e9ce38-f2eb-4897-8b7e-7f6ea9723e44.mp4
from flutter-vector-map-tiles.
Glad you're enjoying it :D There's a lot of room for improvement in the code quality in that area, but I'm not sure if I'll get to it anytime soon since it's working well enough at the moment.
The optimized version seems to have a slower frame rate than the non-optimized version. Not sure if that's because of screen capture.
Here's an example that I recorded recently https://twitter.com/dgreen/status/1518814744341213185
That one doesn't include the latest improvements but it still looks smoother to me. It's probably because the theme is more efficient but I haven't checked.
In case you want to try it I used the "Mapbox Streets" theme for that recording, you can see it here in the gallery
from flutter-vector-map-tiles.
I tried mapbox streets and it's running much smoother compared to the shipped light theme :) However, I experience very high memory peaks when using this theme:
That's 2.6GB in memory for raster pictures. Often the app crashes right after startup, and scrolling a few pixels:
E/Adreno-GSL(13911): <gsl_memory_alloc_pure:2604>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
W/Adreno-GSL(13911): <gsl_ldd_control:553>: ioctl fd 72 code 0xc0300945 (IOCTL_KGSL_GPUOBJ_ALLOC) failed: errno 12 Out of memory
My device has 8GB of memory, which should be more than enough.
It's kinda random and doesn't appear every time, with higher zoom levels it is more likely to happen, like:
MapOptions(
center: LatLng(48.9480, 9.4474),
zoom: 18.0,
plugins: [VectorMapTilesPlugin()])
I tried to find out more, but google doesn't know much about this error, and what it causes.
from flutter-vector-map-tiles.
What you're seeing looks a lot like issue #24
I recommend checking:
- you're using
VectorTileLayerOptions(tileOffset: TileOffset.mapbox)
- the maxZoom of
MapOptions(maxZoom: 22)
matches maximumZoom ofNetworkVectorTileProvider(maximumZoom: 22)
I suspect that you have a mismatch between maxZoom
and maximumZoom
of your tile provider, per recommendation 2 above.
Give it a try and let me know how it works out.
from flutter-vector-map-tiles.
Closing until we get some actionable feedback. Feel free to comment/reopen if you're still experiencing the issue.
from flutter-vector-map-tiles.
What you're seeing looks a lot like issue #24
I recommend checking:
- you're using
VectorTileLayerOptions(tileOffset: TileOffset.mapbox)
- the maxZoom of
MapOptions(maxZoom: 22)
matches maximumZoom ofNetworkVectorTileProvider(maximumZoom: 22)
I suspect that you have a mismatch between
maxZoom
andmaximumZoom
of your tile provider, per recommendation 2 above.Give it a try and let me know how it works out.
The adjustment of the zoom solved the problem. Thanks!
Would it make sense to print a warning in this case, indicating that the parameters are different? Both access to maxZoom from the TileProvider and the MapOptions is give at some point.
from flutter-vector-map-tiles.
related: issue #67
from flutter-vector-map-tiles.
Related Issues (20)
- WARN: theme layer type hillshade not implemented HOT 2
- Use local mbtiles file HOT 5
- I can't display my local Mbtiles files Carte.Mbtiles HOT 1
- Not accepting map styles from other sources HOT 1
- Differences in Styles for Mapbox.
- Update flutter_map dependency to 6.1.x HOT 4
- Web support HOT 1
- Question about working with tile server.
- [StyleReader] Converting JSON into a Style HOT 4
- DEpendency problems when upgrading to 6.0.2 HOT 2
- display with rotation is not the same between vector and raster modes in version 7.0.0 HOT 3
- is expressmaps supported? HOT 1
- Package available for web? HOT 2
- Raster Tiles Usage HOT 1
- would something like https://github.com/fleaflet/flutter_map_cancellable_tile_provider help in performance HOT 1
- very low performance HOT 1
- Override background color of VectorTileLayer HOT 1
- Google maps support - Issue HOT 3
- Can't display pg_tileserv and postgis tiles HOT 1
- How to rotate and zoom the map like a native map experience
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-vector-map-tiles.