I am trying to use jvectormap and it takes input in the format ISO 3166-1 alpha-2 country codes.
My input is in the form of country names. I have checked for name to code converters in JavasSript, but there are not any.
I was wondering how the conversion is possible, so that I can match my input with the jvectormap input. Any ideas?
Check the link: http://jsfiddle.net/sprugman/fkRnC/7/
The jvectormap input model is like
var gdpData = {
"US": 25,
"CA": 50,
"RU": 100,
"AO": 200,
"AG": 200,
"AR": 400,
"BR":200
};
and also is google geochart better than this one??
You can generate a new map keyed off the country names using the
world_mill_enmap and the country name values from thenameproperties:Then load your data keyed off country names and reference the newly created map:
Applied to the jsfiddle that you had posted: http://jsfiddle.net/hansenmc/fkRnC/8/