update geo module

This commit is contained in:
rolux 2011-11-23 15:53:17 +01:00
parent 2b394ca28b
commit e0d4dd3bec
1619 changed files with 6021 additions and 686370 deletions

View file

@ -2,3 +2,4 @@
tools/geo/json/_cities.json
dev
build/
tools/geo/json/countries.json

View file

@ -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() {

View file

@ -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);

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1 @@
FR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

View file

@ -0,0 +1 @@
AU.png

View file

@ -0,0 +1 @@
AU-AC.png

View file

@ -0,0 +1 @@
AU-AQ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1 @@
NO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

View file

@ -0,0 +1 @@
AIDJ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

View file

@ -0,0 +1 @@
GEHH.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

View file

@ -0,0 +1 @@
DE.png

View file

@ -0,0 +1 @@
IO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1 @@
BJ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show more