Hi Jay,
Thanks for your sample.
Your code have some problem.
If you want to make this layer disappear for zoomlevel 6, please just set the style like this:
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/USStates.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.State1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level05;
Which only make this layer visible between level 1 to 5.
The code as below shows how to make the layer render for different zoomlevel:
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/USStates.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.State1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level05;
// We don't set style for 6 and 7, only show level 8
worldLayer.ZoomLevelSet.ZoomLevel08.DefaultAreaStyle = AreaStyles.State1;
// Ignore 9 and render 10 to 20
worldLayer.ZoomLevelSet.ZoomLevel10.DefaultAreaStyle = AreaStyles.Grass1;
worldLayer.ZoomLevelSet.ZoomLevel10.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
If you want to control this totally in client side, please find the target overlay in JavaScript, and directly make it hide by the OpenLayer’s API.
Wish that’s helpful.
Regards,
Don