pauldendulk/Mapsui — pull request #9 by scottdewald (2014-09-05 15:32:18+00:00)
Title: Improved tile retrieval during rendering

Really appreciate your hard work on Mapsui. It is an awesome project!

When performing recursive searches for tiles to render in RenderGetStrategy, I converted the resolution dictionary to a sorted list at the beginning of the search and used indices to move up to lower resolutions instead of performing dictionary look ups each time. This greatly improves performance when tiles are not found right away resulting in multiple recursive calls.

I first noticed this performance problem when I had multiple layers - one had tiles down to level 19 and the other only to level 11. When zoomed into level 19, it was taking a (relatively) long time to find tiles in the top layer which only goes to level 11 and therefore the screen would stutter when dragging my WPF application. With the below improvement, it drags much more smoothly.