Mapbox Brutile Async Layer slowdowns and panning artifacts

Topics: WinForms Controls
May 14 at 11:08 AM
Edited May 14 at 3:39 PM
Hello Felix

I noticed some strange or wrong behaviour with the mapbox control using a brutile async layer. This is the main code, very simple:
        Dim tileSource1 = BruTile.Predefined.KnownTileSources.Create(BruTile.Predefined.KnownTileSource.BingHybrid)
        Dim Newlay As New SharpMap.Layers.TileAsyncLayer(tileSource1, "Bing Hybrid")
        MapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan
If you turn on MapBox1.ShowProgressBar, tiles seems to be drawn like in groups. Rendering seems to stops some time, and suddenly ten or more tiles are drawn at once, making the mapbox like laggy.
On the other side, with ShowProgressBar turned off, you can notice how tiles are drawn 1 by 1, very fast, with no lag for the user.

This behaviour it's noticeable also when you set SetToolsNoneWhileRedrawing to true, but less pronounced. Sometimes seems to work ok, sometimes mapbox seems laggy and drawing tiles "by groups".

With pan as the mapbox active tool and using a brutile async layer, if you click and move mouse to pan while tiles are still being downloading (and painted) to complete the map background (base map), map seems to move from the actual panning positiong to previous map center point each time a tile is painted.
I think this behaviour could be related to mapbox trying to paint tiles received after click to pan event. You can notice how a few tiles are drawn after click to pan, and then tile draw stops.
This is the result of panning a map while it's still downloading/drawing tiles, notice the missplaced tiles. Map redraws ok after stopping pan action.

Kind regards.
May 17 at 12:47 PM
Is this a new issue or has that been that way for quite some time.
Or do you use a precompiled binary (SharpMap 1.1) or did you compile SharpMap yourself?