moagrius / MapView

(Deprecated, prefer https://github.com/moagrius/TileView) Android widget roughly described as a hybrid between com.google.android.maps.MapView and iOS's CATiledLayer
http://moagrius.github.com/MapView/documentation
69 stars 35 forks source link

Tiles takes more time to get displayed #17

Closed Shusshu closed 11 years ago

Shusshu commented 11 years ago

I know you improved performances and avoid possible outOfMemoryException's but now the tiles takes way more time to load.

I didn't look how you deal with this yet...

moagrius commented 11 years ago

render requests are routed through a handler using sendEmptyMessageDelayed, since each render demand starts an asynctask which are not reliably interruptable, we don't want a bunch going at the same time.

the old version used a 200 millisecond delay; this version uses 250. I doubt you're noticing a 50 ms difference, but feel free to modify that if you wish - you could probably get away with as little as 100.

the caching might be slowing the render down for the first decode on each tile (or each decode after we've maxed out the cache). you can disable that by hacking https://github.com/moagrius/MapView/blob/master/src/com/qozix/mapview/tiles/MapTile.java and commenting out the cache actions in the decode method (lines 112-116, and line 124)

If that helps, post back - if it does, I'll expose a method to make caching optional

Thanks for the feedback.

moagrius commented 11 years ago

caching is now off by default (see readme). LMK if we can close this one.