Hey khalil,
Appreciate the quick reply. The steps that you specified was exactly what i wanted but there is a problem now. If i want to add value styles for certain zoom levels how do i go abt it. I did the following changes to your code
var vstyle = new ValueStyle();
vstyle.ColumnName = "STATE_ID";
vstyle.ValueItems.Add(new ValueItem("1", AreaStyles.Country2));
vstyle.ValueItems.Add(new ValueItem("2", AreaStyles.Antarctica1));
vstyle.ValueItems.Add(new ValueItem("3", AreaStyles.Country1));
vstyle.ValueItems.Add(new ValueItem("40", AreaStyles.Water2));
vstyle.ValueItems.Add(new ValueItem("50", AreaStyles.Wildlife1));
ShapeFileFeatureLayer USLayer = new ShapeFileFeatureLayer(MapPath("~/App_Data/states.shp"));
USLayer.ZoomLevelSet.CustomZoomLevels.Add(GeAreatZoomLevel(7500000, vstyle));
private ZoomLevel GeAreatZoomLevel(double scale, Style areaStyle)
{
ZoomLevel zoomLevel = new ZoomLevel(scale);
zoomLevel.CustomStyles.Add(areaStyle);
return zoomLevel;
}
This worked. Now say i dont wanna apply any styles after a certain zoomlevel what should i do? cos in my application i need to hide certain features after a certain level.
just not giving them styles doesnt hrlp. they render with the previous style for some reason.