I have noticed that when using a custom tile generator, zooming out in the map control produces some wired behavior in the displayed tiles. This not visible with the Bing Tile provider where the zooming out is smooth. I have also noticed some of the zoomed out tiles leave fragments behind. Can you tell what could be the cause for the zooming out behavior to differ between tile providers and how to prevent Tile fragments to remain on the screen.
My setup:
I have a custom tile provider which provides a bank png tiles where I dont have data and for the first zoom levels of the map control where the data is not relevant every tile has been generated and stored i a folder structure before hand so the tile provider just creates an Uri object with the correct path. On zooming in to a map zoom level that has data everything behaves normally, but on zooming out tiles appear to shrink and then get replaced by the tiles form the new zoom level which does not produce the smoothing zooming out effect of the Bing provider. I also get around 40% of the me when I zoom out to a level where the tiles showing data are replaced by empty tiles some tile fragments to remain on the screen.
My tile generator:
C#public abstract class BaseTile : MapTileSourceBase
{
public const int tileSize = 256;
public const int maxZoomLevel = 22;
protected BaseTile()
: base((int)CalculateTotalImageSize(maxZoomLevel), (int)CalculateTotalImageSize(maxZoomLevel), tileSize, tileSize)
{
}
internal static double CalculateTotalImageSize(double zoomLevel)
{
if (zoomLevel < 1.0)
return zoomLevel * tileSize * 2;
return Math.Pow(2.0, zoomLevel) * tileSize;
}
}
public class LCMSImageProvider: BaseImageProvider
{
public LCMSImageProvider()
{
SetTileSource(new LCMSTileSource());
}
protected override MapDependencyObject CreateObject()
{
return new LCMSImageProvider();
}
}
public class LCMSTileSource : BaseTile
{
public LCMSTileSource()
: base()
{
}
public override Uri GetTileByZoomLevel(int zoomLevel, int tilePositionX, int tilePositionY)
{
return BatchLCMSTileFactory.Instance.CreateURI(zoomLevel, tilePositionX, tilePositionY, tileSize, tileSize);
}
}
I have also attached a video to show the problems related to zooming out.
Hi Ivan,
Thank you for your report. Our attempts to reproduce a similar issue were not successful. It could be helpful if you clarify whether the BatchLCMSTileFactory.Instance.CreateURI method always returns unique URLs for tiles at different zoom levels. If the same tile URL is used for different tiles, it may not be reloaded (cached) at runtime.
All tiles which there is data for have unique URI objects, all other tile return a URI object pointing to a blank tile, since there wasn't any reason to create an blank 256x256 image for each tile without data (since typically the data sets cover only 120000 tiles), I assume that the URI objects appear similar. Does this also relate to the general zooming out behavior which appears choppy compared to how the bing provider layer zooms out?
Hi Ivan,
Thank you for your clarification. Having discussed this issue, we decided to correct tile processing behavior when identical URIs are provided. We will continue working on this issue and update this ticket status once we have any results.