ibrierley / flutter_map_vector_tiles

A Vector Tile Plugin for flutter_map
BSD 2-Clause "Simplified" License
14 stars 7 forks source link

Improve performance of text #18

Closed ibrierley closed 3 years ago

ibrierley commented 3 years ago

Text is typically quite resource hungry. I think it's because it needs to recalculate layout every time (even if not repainting, but scaling). Maybe there are some optimisations we can do.

ibrierley commented 3 years ago

I've moved the textPainter layout into the map decoder, so we don't recreate every time and doesn't need recalculations as it never changes. Not sure if this is a bit of a hack or legit yet :). This is preferable to the old method with multiple tiles and zooming as we couldn't do this. Have left the old code in commented out in case there are some problems not spotted.

Feels a lot smoother, but probably needs proper testing!