ThinkGeo.com    |     Documentation    |     Premium Support

Progressive panning & zooming

Hello,


My application works now with tiling cache and multithread mode.


I'm looking for feature such as progressive panning and zooming. I mean, the map is displayed while paning and there is a visual effet while zooming that displays intermediate steps beetween 2 zoom levels.


I'm not sure I'm clear, but something like Google Earth zooming & panning.


Regards,


Patrick.



Patrick, 
  
 Thanks for your post and question. 
  
 I think you are missing something here to show the intermediate steps. Just try setting the PreviewTileCache in your target Overlay. 
  
 Any more questions just feel free to let me know. 
 Thanks. 
  
 Yale 


Yale, 
  
 I did not know about previewTileCache; however, it does not help me; 
 pan is not continuous for me and zoom is not progressive. 
  
 Here is my code, can you please tell me what’s wrong? 
  
       m_MainMap.AdornmentOverlay.ShowLogo = false; 
       m_MainMap.DrawingQuality = DrawingQuality.HighQuality; 
       m_MainMap.SmoothingMode = SmoothingMode.HighQuality; 
       m_MainMap.CompositingQuality = CompositingQuality.HighQuality; 
       m_MainMap.ZoomLevelSnapping = ZoomLevelSnappingMode.None; 
  
       m_MainMap.MaximumScale = 5000000; 
       m_MainMap.MinimumScale = 10; 
       m_MainMap.ThreadingMode = MapThreadingMode.Multithreaded; 
  
       // Cache 
       FileBitmapTileCache bitmapTileCache = new FileBitmapTileCache(); 
       bitmapTileCache.CacheDirectory = getTemporaryMainFolder(); 
       bitmapTileCache.CacheId = “Workfile”; 
       bitmapTileCache.ImageFormat = TileImageFormat.Png; 
       m_WorkfileOverlay.TileCache = bitmapTileCache; 
       m_WorkfileOverlay.PreviewTileCache = bitmapTileCache; 
  
 Thank you, 
 Patrick.

Patrick,


Basically your idea is correct; while one minor mistake is that you set the same tile cache both for the TileCache and its Preview.

LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("WorldLayer", worldLayer);
staticOverlay.TileCache = new FileBitmapTileCache(@"C:\temp", "staticOverlayTileCache");
staticOverlay.PreviewTileCache = new FileBitmapTileCache(@"C:\temp", "staticOverlayPreviewTileCache1");
//staticOverlay.IsBase = true;    // Set this for pan preview works

 

Any more questions just feel free to let me know.
 
Thanks.
 
Yale


Yale, 
  
 With isBase=true … I now get a continuous panning … great; what is the use of this undocumented property ? 
  
 For progressive zoom, it still does not work; the preview tile are not even generated. 
  
 here is my new code: 
       m_MainMap.AdornmentOverlay.ShowLogo = false; 
       m_MainMap.DrawingQuality = DrawingQuality.HighQuality; 
       m_MainMap.SmoothingMode = SmoothingMode.HighQuality; 
       m_MainMap.CompositingQuality = CompositingQuality.HighQuality; 
       m_MainMap.ZoomLevelSnapping = ZoomLevelSnappingMode.None; 
  
       m_MainMap.MaximumScale = 5000000; 
       m_MainMap.MinimumScale = 10; 
       m_MainMap.ThreadingMode = MapThreadingMode.Multithreaded; 
  
       // Cache 
       FileBitmapTileCache bitmapTileCache = new FileBitmapTileCache(); 
       bitmapTileCache.CacheDirectory = getTemporaryMainFolder(); 
       bitmapTileCache.CacheId = "Workfile"; 
       bitmapTileCache.ImageFormat = TileImageFormat.Png; 
       m_WorkfileOverlay.TileCache = bitmapTileCache; 
       m_WorkfileOverlay.PreviewTileCache = new FileBitmapTileCache(@"C:\temp", "staticOverlayPreviewTileCache1"); 
       m_WorkfileOverlay.IsBase = true;

Patrick,


That is very wield, it should work with your code, which version you are using(3.0.426 is the last public version)?
 
Also could you try the following code in HowDoI sample DisplayASingleMap to see it works?

   winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);

            ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\Countries02.shp");
            worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;//AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
            worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay staticOverlay = new LayerOverlay();
            staticOverlay.Layers.Add("WorldLayer", worldLayer);
            staticOverlay.TileCache = new FileBitmapTileCache(@"C:\temp", "staticOverlayTileCache");
            staticOverlay.PreviewTileCache = new FileBitmapTileCache(@"C:\temp", "staticOverlayPreviewTileCache1");
            staticOverlay.IsBase = true;    // Set this for pan preview works

            winformsMap1.Overlays.Add("WorldOverlay", staticOverlay);

            winformsMap1.ThreadingMode = MapThreadingMode.Multithreaded;
            winformsMap1.ZoomLevelSnapping = ZoomLevelSnappingMode.None;

            winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2);
            winformsMap1.Refresh();

 

Any more questions just feel free to let me know.
 
Thanks.
 
Yale


Patrick, are you operating in multi-threaded mode?   The preview stuff only works in that mode, I think.

Patrick,


Just a reminder that you could get the IsBase description from following posts:
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6289/afv/topic/afpgj/1/Default.aspx#11303
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6289/afv/topic/afpgj/1/Default.aspx#11345
 
Sorry for the missing documentations, we are catching it up.
 
Thanks.
 
Yale

Yale, 
  
 This exact code does not work for me; preview tile caches are not created; 
 I’m using 426 on a x64 vs 2008 
  
 Patrick.

Patrick, 
  
   The lack of documentation is really my fault.  I was supposed to have a video out explaining all of the new release stuff and have just been hammered lately.  I have been letting the forums pickup the slack on this and we will get the documentation out for it and also integrated into samples as well to show it off much better. 
  
  A word of warning is that as you apply the IsBase=true to more overlays the map panning is going to get slower.  We suggest you limit its use to one overlay if possible, the base one that is. 
  
 David

Patrick, 
  
 Could you make a small sample application for us? We tested the code with Vista64 bit and XP 64 bit, both of them works fine with preview. 
  
 Thanks. 
  
 Yale 


Yale,


Here you are, the preview tile folder is not even created.


FYI my env is, ms 3.0.426; vs 2008 sp1; Windows 7 64 bits; french environment

I tested in under vista 64 bits instead of W7 and I get the same issue.


Hope this helps,


Patrick.



1333-PreviewNotCreated.zip (14.9 KB)

Patrick, 
  
 Thanks for your code that definitely helps. 
  
 We have changed some minor logics in FileBitmapTileCache to fix some bugs while keeping its APIs unchanged.   I tested the code in latest version which will be public within this week and it works fine. 
  
 So please keep an eye on the latest release and have a try, if any more problems just feel free to let me know. Sorry for the inconvenience now. 
  
 Thanks. 
  
 Yale 


Yale, 
  
 thank you for fixing it; I’ll need the temporary version with that fix, can you make it available shortly ? 
  
 Regards, 
 Patrick.

Patrick, 
  
 I will contact our support to send you a temperary version if the new public release cannot come out today. 
  
 Sorry for the delay. 
  
 Thanks. 
  
 Yale 


Patrick, 
  
   The new version is either out or coming our in the next hour or so.  Try to get the latest version from our website after lunch (CST). 
  
 David

Patrick,  
  
 The new versions are all now available via the Customer Portal.

All, 
  
 I cannot see any difference with 3.0.453; the preview folder is still not created and there is no visual zoom in/out effect. 
 The only difference that I can see is that pan is much more slower than with 426. 
  
 Regards, 
 Patrick.

Patrick, 
  
 Sorry for the inconvinience we have made now. 
  
 The reason for this problem we made some other changes without noticing this problem, we have fixed it and make sure it works , I will arrange to send you a temperary version at the early of next week with this problem fixed. 
  
 Please respond back to keep this thread alive. 
  
 Thanks. 
  
 Yale 


Please send me the temporary build as soon as you can. 
  
 Patrick.