ThinkGeo.com    |     Documentation    |     Premium Support

ValueStyle not displaying TextStyles?

I have a shapefile that contains both large and small cities. I can succesfully get the PointStyle to be different however the TextStyle doesn't draw, am I doing this wrong?


        Dim TownStyles As New ValueStyle()
        TownStyles.ColumnName = "SYMBOL"
        TownStyles.ValueItems.Add(New ValueItem(100, PointStyles.Capital1))
        TownStyles.ValueItems.Add(New ValueItem(100, TextStyles.Capital1("NAME")))
        TownStyles.ValueItems.Add(New ValueItem(200, PointStyles.City2))
        TownStyles.ValueItems.Add(New ValueItem(200, TextStyles.City2("NAME")))
        'Towns.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TownStyles)



Michael, 
 We can’t add 2 ValueItems with the same Value; otherwise the 2nd ValueItem will be ignored. Here are the modified codes that work fine. 
  
 
Dim TownStyles As New ValueStyle() 
TownStyles.ColumnName = "SYMBOL" 

Dim StyleFor100 As New Collection(Of Style)() 
StyleFor100.Add(TextStyles.City1("AREANAME")) 
StyleFor100.Add(PointStyles.Capital1) 
TownStyles.ValueItems.Add(New ValueItem("100", StyleFor100)) 

Dim StyleFor200 As New Collection(Of Style)() 
StyleFor200.Add(TextStyles.City1("AREANAME")) 
StyleFor200.Add(PointStyles.Capital1) 
TownStyles.ValueItems.Add(New ValueItem("200", StyleFor200))
 
  
  Thanks, 
 Ben 


Brilliant, NOW for something outside the box :) 
  
 I have major cities with Symbol 100, Minor Cities with Symbol 200 and a range of other numbers which relate to different kinds of places. 
  
 In ArcMap I have it “value” styled and there is an option for “Everything else”, or put in another way NOT 100 AND NOT 200. I was thinking of using a Regex but I can’t seem to work out a Regex expression that just excludes 2 numbers. 
  
 What are you thoughts to best implement this? 
  
 Cheers and quite amazed at the turn around time on support, Keep up the good work.


 Michael, 
  
 It can be implemented using RegexStyle with “NOT 100 AND NOT 200”, please see the following code: 
  
 
Dim items As New Collection(Of RegexItem)() 
Dim style As New Collection(Of Style)() 
style.Add(PointStyles.Capital2) 
style.Add(TextStyles.Capital2("AREANAME")) 
items.Add(New RegexItem("^((?!100|200).)*$", style)) 
Dim regexStyles As New RegexStyle("PLACEFIP", items) 
 
 Thanks, 
  
 Ben