OpenStreetMapOverlay osmOvelerlay = new OpenStreetMapOverlay(); osmOvelerlay.CacheDirectory = @"C:\temp\OpenStreetMapLayerCache1";
winformsMap1.Overlays.Add(osmOvelerlay);
LayerOverlay m_GeosetOverlay = new LayerOverlay(); m_GeosetOverlay.TileCache = new InMemoryBitmapTileCache(); // <=== this is the line which causes the flash
winformsMap1.Overlays.Add(m_GeosetOverlay);
winformsMap1.CurrentExtent = new RectangleShape(-4352400.53526627, 8867834.11959479, 10425951.3896003, -2890780.54967516); winformsMap1.Refresh(); }
Thanks for your post, I noticed that if i used the FileBitMapTileCache instead of an InMemoryBitMapTile Cache the flash no longer occurs. I pulled the code I used below from the "UsingTileCache" How Do I sample under the "Getting Started" section.
OpenStreetMapOverlay osmOvelerlay = new OpenStreetMapOverlay(); osmOvelerlay.CacheDirectory = @"C:\temp\OpenStreetMapLayerCache1";
winformsMap1.Overlays.Add(osmOvelerlay);
LayerOverlay m_GeosetOverlay = new LayerOverlay();
FileBitmapTileCache bitmapTileCache = new FileBitmapTileCache(); bitmapTileCache.CacheDirectory = @"..\..\SampleData\Data\SampleCacheTiles"; bitmapTileCache.CacheId = "World02CachedTiles"; bitmapTileCache.TileAccessMode = TileAccessMode.ReadOnly; bitmapTileCache.ImageFormat = TileImageFormat.Png; m_GeosetOverlay.TileCache = bitmapTileCache; //m_GeosetOverlay.TileCache = new InMemoryBitmapTileCache(); // <=== this is the line which causes the flash
winformsMap1.Overlays.Add(m_GeosetOverlay);
winformsMap1.CurrentExtent = new RectangleShape(-4352400.53526627, 8867834.11959479, 10425951.3896003, -2890780.54967516); winformsMap1.Refresh();
Hope this helps, but let us know if you have any questions!
you are using pre-calculated tiles and it works, but it’s not at all what I’m trying to do. I’m trying to generate the map tile on the fly, in order to speed up the redraw.
Trying to change m_GeosetOverlay.TileCache = new InMemoryBitmapTileCache(); to m_GeosetOverlay.TileCache = new FileBitmapTileCache(@"c:\temp\test");
We’ve confirmed this is a bug and will fix it since 5.5.36.0 (Dev Branch) and 5.5.0.36(Release Branch) revision. Please get the latest daily build and have another try.
We’ve confirmed this is a bug and will fix it since 5.5.36.0 (Dev Branch) and 5.5.0.36(Release Branch) revision. Please get the latest daily build and have another try.
In 5.5.0.36, in multithread mode (Map.ThreadingMode = MapThreadingMode.Multithreaded;) the background layer is not refreshed anymore when user zoom with wheel.
The background layer not displayed issue is fixed with 5.5.0.40, thank you. The flashing issue is partially fixed.
when you zoom/pan to an area already displayed, it does not occur anymore. However, if you pan/zoom to an area not yet displayed, the flash is still there.
Sorry to say, we can’t recreate it. Please look for an e-mail from our support team with information on how to download a video of our attempt to recreate this. It shows how we were trying to recreate it but failed, could you please provide a video shows how you can recreate it?
We see similar flash in silverlight edition as well. To improve the speed, we just added server cache. Below is the way we create server cache for each instance of ServerLayerOverlay.
layerOverlay.ServerCache =
new ServerCache("somepath");But still, we could see sometimes it flashes when we pan/zoom. Since the cache is maintained at the server, we may not achieve the performance/speed that we do in windows edition where the cache is maintained on the client machine. I am just guessing. Is there a way to improve it further?
I guess the “flash” you mean here is the tile not loading fast enough even it’s in the cache, right? As you said it may not achieve the same performance as Desktop Edition where client cache is maintained, but after some checking I think we still have some space to improve. We’ve added it to our issue tracking system and will work on it pretty soon, and I will keep you updated here.
We’ve completed this issue in the latest Daily Build (5.5.113.0) which would be available to download in one or two days, please have another try then.
We’ve completed this issue in the latest Daily Build (5.5.113.0) which would be available to download in one or two days, please have another try then.