Hi ,
We have a problem with caching layers, by using the Map Suite MVC Edition 7.0.0. If we use the ‘servercache’ class nothing happens (cache is not working and the given directory has not been created). See the source I use below:
LayerOverlay staticLayer = new LayerOverlay();
staticLayer.ServerCache = serverCache;
staticLayer.TileType = TileType.MultipleTile;
staticLayer.WebImageFormat = WebImageFormat.Png;
staticLayer.TransitionEffect = TransitionEffect.Stretching;
Hope you can help me out!
Regards,
Jeroen van Heel
ServerCache problems MVC Edition 7.0.0
Hi Jeroen,
Thanks for your post, and welcome to MapSuite Forums.
We tried to recreate the problem but it didn't show up, attatech is a test sample of our test. Here is our test sample would you please check it and tell us what we missed?
If there are any issues, Please feel free to let us know.
Waiting for your further information
Summer
i can’t download the sample
We have downloaded your sample and tested it (with Map Suite 7.0), but there was no cache folder created(!)
On the server there is also an MVC project with the Map suite 6.0 with the exact the same code. With 6.0 there are no problems with caching, whatsoever. Also with the WPF edition (7.0) we have no caching problems.
we have tried:
ServerCache serverCache = new ServerCache(@"C:\temp\CACHE");
serverCache.CacheId = aMapModel.Legend.CacheId;
LayerOverlay staticLayer = new LayerOverlay();
staticLayer.ServerCache = serverCache;
staticLayer.TileType = TileType.MultipleTile;
staticLayer.WebImageFormat = WebImageFormat.Png;
staticLayer.TransitionEffect = TransitionEffect.Stretching;
And still there isn’t a cache folder is created. Even when we try to manually create the cache folder, the tiles aren’t created.
Are you sure that caching works in MVC (compared to 6.0)?
Hi Jeroen,
Thanks for your further information, we tested with the latest version 7.0.42.0 and We also deployed it on iis to test but the problem still didn’t show up. Would you please get the latest dlls(7.0.42.0) and try it again? if the problem is still there, Would you please upload your dlls to us for a further test?
Waiting for your further information.
Summer
Dear Johnny,
We downloaded the latest build and have done some more research about the problem. Here is our conclusion. When we work with:
- one custom overlay (with servercache enabled), everything seems to work fine.
- one custom overlay without servercache, everything seems to work fine.
- two custom overlays the layers in the first overlay are loaded. The second (or third) overlay is never drawn on the map (and isn’t being cached as well).
Our conclusion: using multiple overlays with and without servercache causes problems when drawing (only the first overlay is being drawn).
ServerCache serverCache = new ServerCache(aCachLocation);
serverCache.CacheId = aMapModel.Legend.CacheId;
LayerOverlay lifeLayer = new LayerOverlay();
lifeLayer.ServerCache = serverCache;
lifeLayer.TileType = TileType.MultipleTile;
lifeLayer.WebImageFormat = WebImageFormat.Png;
lifeLayer.TransitionEffect = TransitionEffect.Stretching;
LayerOverlay staticLayer = new LayerOverlay();
staticLayer.ServerCache = serverCache;
staticLayer.TileType = TileType.MultipleTile;
staticLayer.WebImageFormat = WebImageFormat.Png;
staticLayer.TransitionEffect = TransitionEffect.Stretching;
aMapModel.Map.CustomOverlays.Add(lifeLayer);
aMapModel.Map.CustomOverlays.Add(staticLayer);
We didn’t seem to have this behavior in Map Suite 6.0 Are we doing something wrong?
Hi, Jeroen
Could you please try this code? now it should work well.
LayerOverlay overlayStates = new LayerOverlay();
overlayStates.IsBaseOverlay = false;
overlayStates.ServerCache = new ServerCache(@"C:\temp\CACHE");
overlayStates.ServerCache.CacheId = "statesCache";
LayerOverlay overlayCountries02 = new LayerOverlay();
overlayCountries02.IsBaseOverlay = false;
overlayCountries02.ServerCache = new ServerCache(@"C:\temp\CACHE");
overlayCountries02.ServerCache.CacheId = "countriesCache";
ShapeFileFeatureLayer countriesLayer = new ShapeFileFeatureLayer(@"…\Countries02.shp");
countriesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.State1;
countriesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
overlayCountries02.Layers.Add(countriesLayer);
ShapeFileFeatureLayer statesLayer = new ShapeFileFeatureLayer(@"…\USStates.shp");
statesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
statesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
overlayStates.Layers.Add(statesLayer);
map.CustomOverlays.Add(overlayCountries02);
map.CustomOverlays.Add(overlayStates);
return View(map);
If you have any more issues, please feel free to let us know.
Best Regards
Summer