I hope to use the new "LegendAdornmentLayer" MapSuite 5.0 by searching "ImageStyle" in the layers of the Map.
So I have two questions about the style "Class Breaks" :
1) how to name each ValueItem "Class Breaks"
With 2.0, It was possible to set a Name (SymbolValueRenderer) Dim values As New SymbolValueCollection() values.Add(New SymbolValueRenderer.Value("1", symbol1, "Name 1")) values.Add(New SymbolValueRenderer.Value("2", symbol2, "Name 2")) Dim valuesRender As New SymbolValueRenderer("Notes", values) mylayer.ZoomLevel01.GeoStyle.SymbolRenderers.Add(valuesRender)
With 5.0, Is it possible to specify the name of a ValueItem?
Dim values As New Collection(Of ValueItem)() values.Add(New ValueItem("1", New AreaStyle(contour, New GeoSolidBrush(GeoColor.StandardColors.DarkGreen)))) values.Add(New ValueItem("2", New AreaStyle(contour, New GeoSolidBrush(GeoColor.StandardColors.LightGreen)))) Dim valuesRender As New ValueStyle("Notes", values) mylayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valuesRender) AddHandler mylayer.FeatureSource.CustomColumnFetch, AddressOf mylayer_GetDataNotes 2) how to find the ImageStyle for a "Class Breaks" to set the legendItem.ImageStyle. If the style is set as :
Sorry I said a method already removed, about your questions:
1. you can't get each class break by name, you can only get them by value.
2. when you get each class break by value, and then you can get the style of this class break and then set to the legend item.
I hope this code can give you some help.
If style.GetType() Is GetType(CustomClassBreakStyle) Then For Each cbItem As ClassBreak In CType(style, CustomClassBreakStyle).ClassBreaks Dim legendItem As New LegendItem() legendItem.Width = ItemWidth legendItem.Height = ItemHeight legendItem.LeftPadding = ItemLeftPadding legendItem.TextLeftPadding = ItemTextLeftPadding legendItem.ImageWidth = ItemWidth legendItem.ImageHeight = ItemHeight
legendItem.ImageStyle = cbItem.DefaultLineStyle legendItem.TextStyle = New TextStyle(cbItem.Value, New GeoFont("Tahoma", 10), New GeoSolidBrush(GeoColor.SimpleColors.Black)) legendLayer.LegendItems.Add(legendItem) Next End If
Any more questions please feel free to let me know.