ThinkGeo.com    |     Documentation    |     Premium Support

How to know the contry



As per the code


If i want to color in any reasion then i have to provide the no "1,2,3,4"




Now My Doubt is how do i know which reasion is 1 or 2 or 3



Let say if i want to color Austrilya as green and india as red. how do i know which country code i need to use ?



 


 


The sample code says


 


  valueStyle = new ValueStyle();"COLOR_MAP";//valueStyle.ValueItems.Add(new ValueItem("2",AreaStyles.new ValueItem("1", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Green, GeoColor.StandardColors.Black)));new ValueItem("2", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Pink, GeoColor.StandardColors.Black)));new ValueItem("3", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Cyan, GeoColor.StandardColors.Black)));new ValueItem("4", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Purple, GeoColor.StandardColors.Black)));new ValueItem("5", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Goldenrod, GeoColor.StandardColors.Black)));new ValueItem("6", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Salmon, GeoColor.StandardColors.Black)));new ValueItem("7", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Coral, GeoColor.StandardColors.Black)));new ValueItem("8", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.SkyBlue, GeoColor.StandardColors.Black)));new ValueItem("9", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Indigo, GeoColor.StandardColors.Black)));new ValueItem("10", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Navy, GeoColor.StandardColors.Black)));

Dear Friends Please do help me :)



ValueStyle


valueStyle.ColumnName =


 


 


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(


valueStyle.ValueItems.Add(



I don't understand very well everything you are asking but I think that the project ValueStyle with Countries should help you. Please, check it out:


code.thinkgeo.com/projects/s...ecountries



Actually i was asking how do i color a specific country. 
 Because i i use "1" then all 4/5 contries are geting same color. 
  
 I want to make different country in differant colour.Can we do that ?? 
  


Manas,


Thanks for your reply,


I think I understand your mean fully, please see the code below:


ValueStyle valueStyle = new ValueStyle();
valueStyle.ColumnName = "CNTRY_NAME";
 valueStyle.ValueItems.Add(new ValueItem("Australia", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Green, GeoColor.StandardColors.Black)));
 valueStyle.ValueItems.Add(new ValueItem("China", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Pink, GeoColor.StandardColors.Black)));
 valueStyle.ValueItems.Add(new ValueItem("United States", AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Cyan, GeoColor.StandardColors.Black)));


I just rendered the Australia, China and USA countries by the special color, in this code, you can see I rendered the special county according to the CNTRY_NAME field, not the COLOR_MAP field, the COLOR_MAP reprents a kind of countries, so when you rendered the "1" value for the COLOR_MAP field, it will render all countries with "1" COLOR_MAP value.


If you have any other questions please let me know,


Thanks,


Scott,



Hai Scott,  
 Its was cool its working properly. I got to know the table structure also. 
  
 I have one more doubt :) 
 In my map i want to show some specific country names only. 
  
 How do do it? 
  
 I have tryed the same way as in the avove code. but while setting text properly its showing an error "You are trying to use both a default style and the custom styles collection.  You may only use one or the other." 
  
 And if i am adding custom style i am not able to do it. 
  
 Can you help? 
  


Can you send us the code you have so far for having only certain records labeling and we will show you how to correct it? Thank you.

Its solved . 
 Thanks for the help guyes

Manas, 
  
 Thanks for letting us know your status. 
  
 Any more questions just feel free to let us know. 
  
 Yale