I have a highways shape file and want to display an image with the highway name over each one. The image is the symbol for interstate, state highway, etc. The highways and names display ok, but the images never show up. Here is the code, any ideas what I'm missing?
layer = new ShapeFileFeatureLayer(MAPPING_PATH + "highways.shp");
layer.ZoomLevelSet.ZoomLevel08.CustomStyles.Add(new TextStyle("NAME", new GeoFont(this.Font.FontFamily.Name, 10), new GeoSolidBrush(GeoColor.StandardColors.Black)));
I am sorry you probablly cannot get the image out because the PointStyle only draw when the feature is in PointType. Try using the ValueIconStyle instead.
I tried to change your code as following:
ShapeFileFeatureLayer symbolLayer = new ShapeFileFeatureLayer(MAPPING_PATH + "highways.shp"); Color color = Color.Yellow; symbolLayer.ZoomLevelSet.ZoomLevel08.DefaultLineStyle = new LineStyle(new GeoPen(new GeoColor(color.R, color.G, color.B)), new GeoPen(new GeoColor(color.R, color.G, color.B))); symbolLayer.ZoomLevelSet.ZoomLevel08.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
TextStyle textStyle = new TextStyle("NAME", new GeoFont(this.Font.FontFamily.Name, 10), new GeoSolidBrush(GeoColor.StandardColors.Black)); ShapeFileFeatureLayer labelLayer = new ShapeFileFeatureLayer(MAPPING_PATH + "highways.shp"); IconValueStyle iconValueStyle = new IconValueStyle(); iconValueStyle.ColumnName = "SHIELD"; iconValueStyle.IconValueItems.Add(new IconValueItem("I", new GeoImage(FEATURE_IMAGE_PATH + "interstate_highway.bmp"), textStyle)); iconValueStyle.IconValueItems.Add(new IconValueItem("U", new GeoImage(FEATURE_IMAGE_PATH + "us_highway.bmp"), textStyle)); iconValueStyle.IconValueItems.Add(new IconValueItem("S", new GeoImage(FEATURE_IMAGE_PATH + "state_highway.bmp"), textStyle)); labelLayer.ZoomLevelSet.ZoomLevel08.CustomStyles.Add(iconValueStyle); labelLayer.ZoomLevelSet.ZoomLevel08.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;