ThinkGeo.com    |     Documentation    |     Premium Support

Cache in CustomOverlays?

I wonder is there any cach feature when using CustomOverlays? Can't find it in any of the demos.



We have cache features on the LayerOverlay. You can create a LayerOverlay, turn on its caches and add it to the CustomOverlays collection. Following is the sample code: 
  
 
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/world/cntry02.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

LayerOverlay worldOverlay = new LayerOverlay("WorldOverlay");
worldOverlay.Layers.Add(worldLayer);
worldOverlay.Name = "ThinkGeo Map";
worldOverlay.ClientCache.CacheId = "WorldOverlay";
worldOverlay.ServerCache.CacheDirectory = MapPath("~/ImageCache/" + Request.Path);

Map1.CustomOverlays.Add(worldOverlay);
 
  
 Ben. 
   


Got it. But is there any thing we can configure to specify at runtime how Thinkgeo handles the cached images? like specifying how many tiles to put in cache on the left, right, up, down of the displayed map image, or the maximum bandwidth to use in fetching images…etc

Ric,


We don't have that "advanced configuration" for caching for now. Thanks for your suggestion, I will write it down to see if we need to add those controls in the future. 


BTW, here is the White Paper about using cache, please have a look if you are interested.


Using Cache in Map Suite Web Edition 3.0 


Ben.



Thanks Ben, this answered my question.

Thanks again for your insights, any suggestion is appreciated!