Closed sergeantcrayon closed 9 years ago
osmbonuspack 5.1 is based on osmdroid 4.3.
Just updated it. Its still slow. more specifically. its only slow when the screen is only displaying part of the polyline. so its actually okay when the whole polyline is on the screen or none of it at all.
I have the same problem than you.
Use mbtiles made with "mbutil" tool. Display offline maps with OSMDroid 5.0.1 and OSMBonusPack 5.6.1 on Nexus6p, Android SDK 23. It's works fine.
But when adding a simple Polyline (2 points, no geodesic) define at level 13 (20km), when render on max zoom (150m), consumme a lot of GPU (mainly Misc Time) and scrolling is slow. Go to upper zoom, works better. Problems occur only when adding a Polyline on a zoom level and zoom to a more detailled level. it's worse with Polygon. Logs show that "draw" call is fast, no problem with projection of points or things like this.
Use code from "stellardeveloper", https://github.com/MKergall/osmbonuspack/issues/171 with last changes and works fine. Thanks to him.
I verify it, the last OSMDroid code don't use "stellardeveloper" code, however this code works fine, no bugs detected.
Another solution, tested with success, replace drawPath by drawLines (see stackoverflow). Use original code, add an array of floats, when setting moveTo or lineTo (same for code that split segments exceeding 180°), add coordinates to this array (start and end of segment), use this array with canvas.drawLines() method. Works fine (exceeding 180° not tested). Lines never disappear.
Context: I am using offline .mbtiles created from MapTiler and simply placing it in the sd card. Using android 5.1, osmbonuspack 5.1, osmdroid 4.2 i have tested this with a physical note 4 device and a virtual nexus 7 from eclipse
Code in question:
at zoom 16 below, there's no performance issues. It starts to slow down at zoom 17. at zoom 18 its barely moving and i'm getting 'skipping frames' logs on my logcat. the concerning part about this is that there's only 3 polylines created. I have also tried using PathOverlay, it has the same issue. can anyone help me with this issue? thank you.