update geo module
|
@ -2,3 +2,4 @@
|
|||
tools/geo/json/_cities.json
|
||||
dev
|
||||
build/
|
||||
tools/geo/json/countries.json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Ox.load({UI: {}, Geo: {}}, function() {
|
||||
Ox.load({UI: {theme: 'modern'}, Geo: {}}, function() {
|
||||
|
||||
var $list = Ox.IconList({
|
||||
//borderRadius: 32,
|
||||
|
@ -6,9 +6,10 @@ Ox.load({UI: {}, Geo: {}}, function() {
|
|||
return {
|
||||
height: size,
|
||||
id: data.code,
|
||||
info: data.code,
|
||||
title: data.name,
|
||||
url: Ox.getImageByGeoname('icon', 256, data.name),
|
||||
info: data.region,
|
||||
title: data.name + ' (' + data.code + ')',
|
||||
url: Ox.getFlagByGeoname(data.name, 256),
|
||||
//url: '../../tools/_geo3/svg/icons/' + data.code + '.svg',
|
||||
width: size
|
||||
}
|
||||
},
|
||||
|
@ -30,7 +31,7 @@ Ox.load({UI: {}, Geo: {}}, function() {
|
|||
],
|
||||
orientation: 'vertical'
|
||||
})
|
||||
.appendTo(Ox.UI.$body)
|
||||
.appendTo(Ox.UI.$body);
|
||||
|
||||
/*
|
||||
Ox.UI.$window.resize(function() {
|
||||
|
|
|
@ -13,18 +13,22 @@ Ox.load.Geo = function(options, callback) {
|
|||
<a href="http://en.wikipedia.org/wiki/List_of_sovereign_states">Wikipedia</a>),
|
||||
other entities with
|
||||
<a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>
|
||||
country codes, and former countries according to <a href="http://en.wikipedia.org/wiki/ISO_3166-3">ISO 3166-3</a>
|
||||
country codes, and former countries according to
|
||||
<a href="http://en.wikipedia.org/wiki/ISO_3166-3">ISO 3166-3</a>
|
||||
and <a href="http://www.imdb.com/country/">IMDb</a>.
|
||||
area <n> Area of the country in square meters
|
||||
code <s> ISO 3166-1 alpha-2 country code
|
||||
created <o> FIXME: incomplete data
|
||||
dependencies <[s]> Array of dependencies of the country
|
||||
dependency <[s]> Array of countries the country is a dependency of
|
||||
disputed <[s]> Array of countries the country is disputed by
|
||||
disputes <[s]> Array of countries the country disputes
|
||||
dissolved <[s]> Array of countries the country has been dissolved (merged, renamed or split) into
|
||||
dissolved <o> Present if the country was dissolves
|
||||
country <s|[s]> Succeeding country or countries
|
||||
date <s> Date of dissolution
|
||||
type <s> "joined", "merged", "renamed" or "split"
|
||||
east <n> Longitude of eastern boundary in deg
|
||||
googleName <s|u> Google Maps country name
|
||||
imdbCode <s|u> IMDb country code
|
||||
imdbName <s|u> IMDb country name
|
||||
languages <[s]> Array of languages that are spoken in this country more than in any other
|
||||
lat <n> Latitude of the center in deg
|
||||
|
@ -33,64 +37,42 @@ Ox.load.Geo = function(options, callback) {
|
|||
north <n> Latitude of northern boundary in deg
|
||||
other <b> True if the country is an "other entity" (EU, FX, UK)
|
||||
south <n> Latitude of southern boundary in deg
|
||||
wikipediaURL <s> URL of the wikipedia article for the country
|
||||
wikipediaName <s> Wikipedia country name (http://en.wikipedia.org/wiki/$wikipediaName)
|
||||
west <n> Longitude of western boundary in deg
|
||||
<script>
|
||||
Ox.test.array = [
|
||||
// Current independent countries with dependencies
|
||||
// Current independent countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.dependencies.length && !c.dissolved.length && !c.other;
|
||||
}).length,
|
||||
// Current independent countries with (fixme: not necessarily current) disputes
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.disputes.length && !c.dissolved.length && !c.other;
|
||||
}).length,
|
||||
// Current independent countries without dependencies or disputes
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return !c.dependencies.length && !c.dependency.length
|
||||
&& !c.disputes.length && !c.disputed.length
|
||||
&& !c.dissolved.length && !c.other;
|
||||
return !c.dissolved && !c.dependency && !c.disputed
|
||||
}).length,
|
||||
// Current dependent countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.dependency.length && !c.dissolved.length && !c.other;
|
||||
return !c.dissolved && c.dependency
|
||||
}).length,
|
||||
// Current disputed countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.disputed.length && !c.dissolved.length && !c.other;
|
||||
return !c.dissolved && c.disputed
|
||||
}).length,
|
||||
// Former independent countries with dependencies
|
||||
// Dissolved independent countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.dependencies.length && c.dissolved.length && !c.other;
|
||||
return c.dissolved && !c.dependency && !c.disputed
|
||||
}).length,
|
||||
// Former independent countries with disputes
|
||||
// Dissolved dependent countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.disputes.length && c.dissolved.length && !c.other;
|
||||
return c.dissolved && c.dependency
|
||||
}).length,
|
||||
// Former independent countries without dependencies or disputes
|
||||
// Dissolved disputed countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return !c.dependencies.length && !c.dependency.length
|
||||
&& !c.disputes.length && !c.disputed.length
|
||||
&& c.dissolved.length && !c.other;
|
||||
}).length,
|
||||
// Former dependect countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.dependency.length && c.dissolved.length && !c.other;
|
||||
}).length,
|
||||
// Former disputed countries
|
||||
Ox.COUNTRIES.filter(function(c) {
|
||||
return c.disputed.length && c.dissolved.length && !c.other;
|
||||
}).length,
|
||||
// Other entities
|
||||
Ox.COUNTRIES.filter(function(c) { return c.other; }).length
|
||||
return c.dissolved && c.disputed
|
||||
}).length
|
||||
];
|
||||
</script>
|
||||
> Ox.COUNTRIES.length
|
||||
311
|
||||
319
|
||||
> Ox.sum(Ox.test.array)
|
||||
311
|
||||
319
|
||||
> Ox.test.array
|
||||
[13, 8, 176, 73, 7, 1, 0, 16, 13, 1, 3]
|
||||
[202, 77, 6, 22, 11, 1]
|
||||
@*/
|
||||
|
||||
Ox.COUNTRIES = data;
|
||||
|
@ -122,7 +104,7 @@ Ox.load.Geo = function(options, callback) {
|
|||
name <s> Geoname
|
||||
> Ox.getCountryByGeoname('Los Angeles, California, United States').code
|
||||
'US'
|
||||
> Ox.getCountryByGeoname('The Bottom, Saba, Bonaire, Saint Eustatius and Saba').code
|
||||
> Ox.getCountryByGeoname('The Bottom, Saba, Bonaire, Sint Eustatius and Saba').code
|
||||
'BQ'
|
||||
@*/
|
||||
|
||||
|
@ -131,7 +113,7 @@ Ox.load.Geo = function(options, callback) {
|
|||
geoname = geoname.replace(' - United Arab Emirates', ', United Arab Emirates')
|
||||
return Ox.getCountryByName(
|
||||
geoname.split(', ').pop()
|
||||
.replace('Saint Eustatius', 'Bonaire, Saint Eustatius')
|
||||
.replace('Sint Eustatius', 'Bonaire, Sint Eustatius')
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -164,10 +146,10 @@ Ox.load.Geo = function(options, callback) {
|
|||
geoname <s> Geoname
|
||||
@*/
|
||||
|
||||
Ox.getImageByGeoname = function(type, size, geoname) {
|
||||
Ox.getFlagByGeoname = function(geoname, size) {
|
||||
var country = Ox.getCountryByGeoname(geoname),
|
||||
code = country ? country.code : 'NTHH';
|
||||
return Ox.PATH + 'Ox.Geo/png/' + type + 's/' + size + '/' + code + '.png';
|
||||
code = country ? country.flag || country.code : 'NTHH';
|
||||
return Ox.PATH + 'Ox.Geo/png/flags/' + size + '/' + code + '.png';
|
||||
};
|
||||
|
||||
/*@
|
||||
|
@ -178,7 +160,7 @@ Ox.load.Geo = function(options, callback) {
|
|||
language <s> Language
|
||||
@*/
|
||||
|
||||
Ox.getImageByLanguage = function(type, size, language) {
|
||||
Ox.getFlagByLanguage = function(language, size) {
|
||||
language = language
|
||||
.replace(' languages', '')
|
||||
.replace(' Sign Language', '');
|
||||
|
@ -189,8 +171,8 @@ Ox.load.Geo = function(options, callback) {
|
|||
return false;
|
||||
}
|
||||
});
|
||||
code = country ? country.code : 'NTHH';
|
||||
return Ox.PATH + 'Ox.Geo/png/' + type + 's/' + size + '/' + code + '.png';
|
||||
code = country ? country.flag || country.code : 'NTHH';
|
||||
return Ox.PATH + 'Ox.Geo/png/flags/' + size + '/' + code + '.png';
|
||||
};
|
||||
|
||||
callback(true);
|
||||
|
|
BIN
source/Ox.Geo/png/flags/16/AC.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
source/Ox.Geo/png/flags/16/AD.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/AE.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
source/Ox.Geo/png/flags/16/AF.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/AG.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/AI.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
1
source/Ox.Geo/png/flags/16/AIDJ.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
FR.png
|
BIN
source/Ox.Geo/png/flags/16/AL.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/AM.png
Normal file
After Width: | Height: | Size: 929 B |
BIN
source/Ox.Geo/png/flags/16/ANHH.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/AO.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/AQ.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
source/Ox.Geo/png/flags/16/AR-AQ.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/AR.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
source/Ox.Geo/png/flags/16/AS.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/AT.png
Normal file
After Width: | Height: | Size: 919 B |
1
source/Ox.Geo/png/flags/16/AU-AC.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
AU.png
|
1
source/Ox.Geo/png/flags/16/AU-AQ.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
AU-AC.png
|
1
source/Ox.Geo/png/flags/16/AU-CS.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
AU-AQ.png
|
BIN
source/Ox.Geo/png/flags/16/AU.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/AW.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/AX.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/AZ-NK.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/AZ.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/BA.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/BB.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/BD.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/BE.png
Normal file
After Width: | Height: | Size: 911 B |
BIN
source/Ox.Geo/png/flags/16/BF.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/BG.png
Normal file
After Width: | Height: | Size: 927 B |
BIN
source/Ox.Geo/png/flags/16/BH.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/BI.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/BJ.png
Normal file
After Width: | Height: | Size: 975 B |
BIN
source/Ox.Geo/png/flags/16/BL.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/BM.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/BN.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
source/Ox.Geo/png/flags/16/BO.png
Normal file
After Width: | Height: | Size: 920 B |
BIN
source/Ox.Geo/png/flags/16/BQ.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/BQAQ.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/BR.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/BS.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
source/Ox.Geo/png/flags/16/BT.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/BUMM.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
1
source/Ox.Geo/png/flags/16/BV.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
NO.png
|
BIN
source/Ox.Geo/png/flags/16/BW.png
Normal file
After Width: | Height: | Size: 917 B |
BIN
source/Ox.Geo/png/flags/16/BY.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/BYAA.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/BZ.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
source/Ox.Geo/png/flags/16/CA.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CC.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/CD.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
source/Ox.Geo/png/flags/16/CF.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/CG.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CH.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/CI.png
Normal file
After Width: | Height: | Size: 910 B |
BIN
source/Ox.Geo/png/flags/16/CK.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/CL-AQ.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/CL.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CM.png
Normal file
After Width: | Height: | Size: 987 B |
BIN
source/Ox.Geo/png/flags/16/CN.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CO.png
Normal file
After Width: | Height: | Size: 928 B |
1
source/Ox.Geo/png/flags/16/CP.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
AIDJ.png
|
BIN
source/Ox.Geo/png/flags/16/CR.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CSHH.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CSXX.png
Normal file
After Width: | Height: | Size: 928 B |
1
source/Ox.Geo/png/flags/16/CTKI.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
GEHH.png
|
BIN
source/Ox.Geo/png/flags/16/CU.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/CV.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/CW.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CX.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/CY-NC.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/CY.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/CZ.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/DDDE.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/DE.png
Normal file
After Width: | Height: | Size: 917 B |
1
source/Ox.Geo/png/flags/16/DEDE.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
DE.png
|
1
source/Ox.Geo/png/flags/16/DG.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
IO.png
|
BIN
source/Ox.Geo/png/flags/16/DJ.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/DK.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
source/Ox.Geo/png/flags/16/DM.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/DO.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
1
source/Ox.Geo/png/flags/16/DYBJ.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
BJ.png
|
BIN
source/Ox.Geo/png/flags/16/DZ.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/EA.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/EC.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/EE.png
Normal file
After Width: | Height: | Size: 921 B |
BIN
source/Ox.Geo/png/flags/16/EG.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
source/Ox.Geo/png/flags/16/EH.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/ER.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/ES.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
source/Ox.Geo/png/flags/16/ET.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
source/Ox.Geo/png/flags/16/EU.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
source/Ox.Geo/png/flags/16/FI.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
source/Ox.Geo/png/flags/16/FJ.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/FK.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
source/Ox.Geo/png/flags/16/FM.png
Normal file
After Width: | Height: | Size: 1.1 KiB |