Thanks for your clarify in the email, I see I understand now that you just would like to cache for some specified zoom levels of WmsOverlay, right? In that case, I don't think we doesn't provide any straight-forward method to implement it, but a workaround is using the UpperThreshold and LowerThreshold instead. In other words, if you would like to create the cache for from zoom level 4 to zoom level 7, you need to use WmsRasterLayer instead, the code should be look like as following:
ZoomLevelSet zoomLevelSet =
WmsRasterLayer cachedWmsLayer =
cachedWmsLayer.UpperThreshold = zoomLevelSet.ZoomLevel07.Scale;
cachedWmsLayer.LowerThreshold = zoomLevelSet.ZoomLevel04.Scale;
LayerOverlay cachedOverlay =
WmsRasterLayer nonCachedWmsLayer =
nonCachedWmsLayer.LowerThreshold = 0;
LayerOverlay nonCachedOverlay =
You see there are 2 LayerOverlay and WmsRasterLayer declared, the first one is applied TileCache, but it's just used for the scales between zoom level 4 and 7, and the later one doesn't have TileCache, but it works for all Zoom Levels. If we take the performance into account, it's better we can create 2 non-cached overlays, one is for scales from 0 to zoom level 4, and another for zoom level 7 to zoom level 20.
Please let me know if it helped.