Hi Carlos,
Here are answers for your questions:
1. I only have 5 overlays total, two of them multitile, with 22 and 3 layers respectively. Shoudn't they be only 24 tiles?
The default size for a tile is 256*256, so the number of tiles in each tileOverlay is determined by the map size.
2. How can I debug more preciselly this drawing process (know which overlay is causing the problem, and what problem it is)?
Using tileOverlay's name to identify each tileOverlay's progress should be a proper solution to track precise drawing process.
For example, you can use the following code to track each tileOverlay's drawing progress and examine which progress never reached 100.
private void tileOverlay_DrawTilesProgressChanged(object sender, DrawTilesProgressChangedTileOverlayEventArgs e)
{
TileOverlay currentTileOverlay = (TileOverlay)sender;
currentTileOverlay.OverlayCanvas.Tag = e.ProgressPercentage;
IEnumerable<TileOverlay> tileOverlays = Overlays.OfType<TileOverlay>().Where((to => to.TileType != TileType.SingleTile));
int total = tileOverlays.Count() * 100;
int progress = 0;
Debug.WriteLine("-------------");
foreach (TileOverlay tileOverlay in tileOverlays)
{
if (tileOverlay.OverlayCanvas.Tag != null)
{
var overlayProgress = (int)tileOverlay.OverlayCanvas.Tag;
progress += overlayProgress;
if (overlayProgress <= 100) { Debug.WriteLine(tileOverlay.Name + ":" + overlayProgress); }
}
}
Debug.WriteLine("-------------");
int currentProgress = progress * 100 / total;
OnDrawingProgressChanged(new DrawingProgressChangedExtendedWpfMapEventArgs(currentProgress, null));
}
Regards,
Ivan