Very strange. I have not been able to get the country names or country indicators to appear on my map, however I have been able to change the country color using the same routine and that works. What is going on here???? Here is the code
Dim color_Threshold As New Threshold(100000, 0) 'color map threshold
Dim name_threshold As Threshold
name_threshold = New Threshold(100000, 0) 'country names
Dim symbol_threshold As New Threshold(100000, 0) 'country bullets
'add country bullet points
symbol_threshold.SymbolRenderers.Add(New SymbolRenderer(New PointSymbol(PointStyleEnum.Circle, New Pen(Color.Red), New SolidBrush(Color.Red), Single.Parse(8))))
maplayer.ThresholdUnit = ThresholdUnits.miles
name_threshold.LabelRenderers.Add(New LabelRenderer("cntry_name", New TextSymbol(New Font("arial", 8, FontStyle.Bold), New SolidBrush(Color.Red), 0, 0)))
'-- Setup renderers for color map
Dim Values As New SymbolValueCollection
Values.Add(New SymbolValueRenderer.Value("1", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightBlue))))
Values.Add(New SymbolValueRenderer.Value("2", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightCoral))))
Values.Add(New SymbolValueRenderer.Value("3", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightCyan))))
Values.Add(New SymbolValueRenderer.Value("4", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightGoldenrodYellow))))
Values.Add(New SymbolValueRenderer.Value("5", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightSteelBlue))))
Values.Add(New SymbolValueRenderer.Value("6", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightGreen))))
Values.Add(New SymbolValueRenderer.Value("7", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightPink))))
Values.Add(New SymbolValueRenderer.Value("8", New AreaSymbol(New Pen(Color.Black), New SolidBrush(Color.LightSkyBlue))))
Dim SymbolValueRenderer As New SymbolValueRenderer("color_map", Values)
'add thresholds to layer
maplayer.Thresholds.Add(color_Threshold)
maplayer.Thresholds.Add(name_threshold)
color_Threshold.SymbolRenderers.Add(SymbolValueRenderer)
maplayer.Thresholds.Add(symbol_threshold)
'add the new layer to map
If Not maplayer.HasIndex Then maplayer.BuildIndex()
frm_mainmap.mainmap.Layers.Add(maplayer)
frm_locator.locator.Layers.Add(maplayer)
The color of the map is set by an integer 1~8 that is contained in the cntry02 database and it works very well. The country names are also in the same database and they will not work at all! The bullets are just a simple point but they won't render either. |