Steve,
Here are my answers to your questions:
I believe that longer roads are labeled. Is there any way to override this?
You think that longer roads should be labeled. The default internal logic for labeling already takes that into account. OUr labeling logic will find the longest line segment of the street and label on it. If the label length is higher than the length of the road, it will not be displayed. You can control that by using the property TextLIneSegmentRatio. If you set it to 2, it means that the label length can be up to 2 times longer than line segment to be labeled.
I also recommend that you check the effects of using the spline for street labeling with the property SplineType. I think this is going to improve cosmetically your street labeling.
How do I determine which roads are labeled at a particular zoom level?
Is it possible to add a column to the shape file data to indicate which roads should be labeled at the highest zoom level?
I believe those two questions are related. I think that what you need is to take advantage of the different zoom levels and of the ValueStyle. Below is a very simple example to help you understand the concept.
From zoom level 20 to zoom level 18, I label all roads. From zoom level 17 and beyond, I label only roads of type
See code below, and I think you wil get it:
wpfMap1.MapUnit = GeographyUnit.Feet;
ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(@"C:\ThinkGeo\Support\MapData\FriscoTrans\streets.shp");
LineStyle lineStyle = new LineStyle(new GeoPen(GeoColor.StandardColors.Black, 8),
new GeoPen(GeoColor.StandardColors.LightGoldenrodYellow, 6));
ValueStyle valueTextStyle = new ValueStyle();
valueTextStyle.ColumnName = "TYPE"; //the TextStyle will be based on the value of the column "TYPE".
valueTextStyle.ValueItems.Add(new ValueItem("1", new TextStyle("FULL_NAME", new GeoFont("Arial", 14), new GeoSolidBrush(GeoColor.StandardColors.Black))));
valueTextStyle.ValueItems.Add(new ValueItem("4", new TextStyle("FULL_NAME", new GeoFont("Arial", 10), new GeoSolidBrush(GeoColor.StandardColors.Black))));
//From zoom level 01 (full view) to zoom level 16 (city view), the streets of type "1" and "4" will be labeled with their distinct TextStyle
streetLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(lineStyle);
streetLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueTextStyle);
streetLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level16;
//From zoom level 17 to closest zoom level 20, all streets will be labeled with the same TextStyle.
TextStyle textStyle = new TextStyle("FULL_NAME", new GeoFont("AriaL", 12, DrawingFontStyles.Bold), new GeoSolidBrush(GeoColor.StandardColors.Black));
textStyle.SplineType = SplineType.StandardSplining;
textStyle.TextLineSegmentRatio = 2;
textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping;
streetLayer.ZoomLevelSet.ZoomLevel17.CustomStyles.Add(textStyle);
streetLayer.ZoomLevelSet.ZoomLevel17.CustomStyles.Add(lineStyle);
streetLayer.ZoomLevelSet.ZoomLevel17.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay layerOverlay = new LayerOverlay();
layerOverlay.Layers.Add(streetLayer);
wpfMap1.Overlays.Add(layerOverlay);
streetLayer.Open();
wpfMap1.CurrentExtent = streetLayer.GetBoundingBox();
streetLayer.Close();
wpfMap1.Refresh();