modrana
modrana copied to clipboard
Use bounding box sections when drawing polylines
The basic idea is to only draw what's on the screen and ignore everything else. As iterating over all points would not bring much improvement, we should divide polyline into point batches (let's say 100 points big) and record the bounding box for each point batch. Then when drawing he route we would check which bounding boxes intersect with the screen and only draw the visible ones.
This should reduce the number of points being drawn quite a bit, especially when zoomed in on a long route or logging trace.