Ox.load.Geo = function(options, callback) {
Ox.getJSON(Ox.PATH + 'Ox.Geo/json/Ox.Geo.json', function(data) {
//@ Constants ----------------------------------------------------------
/*@
Ox.COUNTRIES <[o]> Array of countries
A list of independent (or de-facto independent) countries and
dependencies (see
Wikipedia),
other entities with
ISO 3166-1 alpha-2
country codes, and former countries according to ISO 3166-3
and IMDb.
area Area of the country in square meters
code ISO 3166-1 alpha-2 country code
dependencies <[s]> Array of dependencies of the country (country codes)
dependency <[s]> Array of countries the country is a dependency of (country codes)
east Longitude of eastern boundary in deg
former True if the country is a former country
imageURLs Collection of dataURLs
marker Map marker
imdbCode IMDb country code
imdbName IMDb country name
lat Latitude of the center in deg
lng Longitude of the center in deg
name Name
north Latitude of northern boundary in deg
other True if the country is an "other entity" (EU, FX, UK)
south Latitude of southern boundary in deg
wikipediaURL URL of the wikipedia article for the country
west Longitude of western boundary in deg
> Ox.COUNTRIES.length
311
> Ox.sum(Ox.test.array)
311
> Ox.test.array
[15, 189, 74, 1, 16, 13, 3]
@*/
Ox.COUNTRIES = data;
//@ Functions ----------------------------------------------------------
/*@
Ox.getCountryByCode Returns a country object for a given country code
(code) -> Country object
code ISO 3166 country code
> Ox.getCountryByCode('US').name
'United States'
@*/
Ox.getCountryByCode = function(code) {
var country;
Ox.forEach(Ox.COUNTRIES, function(c) {
if (c.code == code) {
country = c;
return false;
}
});
return country;
};
/*@
Ox.getCountryByName Returns a country object for a given country name
(name) -> Country object
name Country name
> Ox.getCountryByName('United States').code
'US'
@*/
Ox.getCountryByName = function(name) {
var country;
Ox.forEach(Ox.COUNTRIES, function(c) {
if (c.name == name) {
country = c;
return false;
}
});
return country;
};
callback(true);
});
}