diff --git a/demos/listmap/index.html b/demos/listmap/index.html index 9454896e..9e8bf31f 100644 --- a/demos/listmap/index.html +++ b/demos/listmap/index.html @@ -1,10 +1,9 @@ - ox.js listmap demoOxJS ListMap Demo - - + diff --git a/demos/listmap/js/listmap.js b/demos/listmap/js/listmap.js index eb01bf48..7c31834e 100644 --- a/demos/listmap/js/listmap.js +++ b/demos/listmap/js/listmap.js @@ -1,52 +1,71 @@ -Ox.load('UI', { - debug: true, - theme: 'modern' -}, function() { +Ox.load({UI: {}, Geo: {}}, function() { - Ox.load('Geo', function() { + var markerColor = { + 'Northern America': [64, 64, 255], + 'Central America': [0, 0, 255], + 'Caribbean': [0, 0, 128], + 'Southern America': [0, 255, 0], + 'Northern Europe': [255, 255, 192], + 'Western Europe': [255, 255, 0], + 'Eastern Europe': [255, 128, 0], + 'Southern Europe': [128, 128, 0], + 'Northern Africa': [128, 128, 128], + 'Western Africa': [64, 64, 128], + 'Middle Africa': [64, 64, 64], + 'Eastern Africa': [128, 64, 64], + 'Southern Africa': [64, 128, 64], + 'Western Asia': [255, 128, 128], + 'Central Asia': [255, 0, 0], + 'Eastern Asia': [128, 0, 0], + 'Southern Asia': [255, 0, 255], + 'South-Eastern Asia': [128, 0, 128], + 'Australia and New Zealand': [0, 128, 128], + 'Micronesia': [192, 255, 255], + 'Melanesia': [0, 255, 255], + 'Polynesia': [128, 128, 255], + 'Antarctica': [192, 192, 192] + }, - var listmap = new Ox.ListMap({ - height: window.innerHeight, - places: Ox.map(Ox.COUNTRIES, function(place) { - return { - alternativeNames: place.googleName ? [place.googleName] : [], - area: place.area, - countryCode: place.code, - editable: true, - flag: place.code, - geoname: place.name, - id: place.code, - name: place.name, - type: 'country', - lat: place.lat, - lng: place.lng, - south: place.south, - west: place.west, - north: place.north, - east: place.east - }; - }), - showTypes: true, - width: window.innerWidth - }) - .bindEvent({ - geocode: function(event, data) { - Ox.print(event) - Ox.print(JSON.stringify(data)) - } - }) - .appendTo(Ox.UI.$body); + $listmap = new Ox.ListMap({ + height: window.innerHeight, + places: Ox.COUNTRIES.map(function(place) { + return { + alternativeNames: Ox.compact([place.google, place.imdb, place.wikipedia]), + area: place.area, + countryCode: place.code, + editable: true, + flag: place.code, + geoname: place.name, + id: place.code, + markerColor: markerColor[place.region] || [128,128,128], + name: place.name, + type: 'country', + lat: place.lat, + lng: place.lng, + south: place.south, + west: place.west, + north: place.north, + east: place.east + }; + }), + width: window.innerWidth + }) + .bindEvent({ + geocode: function(event, data) { + Ox.print(event) + Ox.print(JSON.stringify(data)) + } + }) + .appendTo(Ox.UI.$body); - $(window).resize(function() { - Ox.print('RESIZE', window.innerHeight) - listmap.options({ - height: window.innerHeight, - width: window.innerWidth - }); + $(window).resize(function() { + Ox.print('RESIZE', window.innerHeight) + $listmap.options({ + height: window.innerHeight, + width: window.innerWidth }); - - window.listmap = listmap; - }); + + window.$listmap = $listmap; }); \ No newline at end of file diff --git a/demos/listmap2/js/listmap.js b/demos/listmap2/js/listmap.js index a24168b2..6f2bb7c1 100644 --- a/demos/listmap2/js/listmap.js +++ b/demos/listmap2/js/listmap.js @@ -1,36 +1,33 @@ -Ox.load('UI', { +Ox.load({UI: { debug: true, hideScreen: true, showScreen: true, theme: 'modern' -}, function() { - -Ox.load('Geo', function() { +}, Geo: {}}, function() { Ox.getJSON('json/cities50000.json', function(cities) { var places = cities.map(function(city, i) { - var countryCode = city.country_code == 'XK' ? 'RS-KO' : city.country_code, - marker = city.population > 10000000 ? {size: 24, color: [255, 0, 0]} : - city.population > 5000000 ? {size: 22, color: [255, 32, 0]} : - city.population > 2000000 ? {size: 20, color: [255, 64, 0]} : - city.population > 1000000 ? {size: 18, color: [255, 96, 0]} : - city.population > 500000 ? {size: 16, color: [255, 128, 0]} : - city.population > 200000 ? {size: 14, color: [255, 160, 0]} : - city.population > 100000 ? {size: 12, color: [255, 192, 0]} : - city.population > 50000 ? {size: 10, color: [255, 224, 0]} : - {size: 8, color: [255, 255, 0]}, - area = Math.max(city.population, 1) * 100, + var area = Math.max(city.population, 1) * 100, + geoname = city.name + ', ' + Ox.getCountryByCode(city.country_code).name, latSize = Math.sqrt(area) / Ox.EARTH_CIRCUMFERENCE * 360, - lngSize = Math.sqrt(area) * Ox.getDegreesPerMeter(city.latitude); + lngSize = Math.sqrt(area) * Ox.getDegreesPerMeter(city.latitude), + marker = city.population > 10000000 ? {size: 24, color: [255, 0, 0]} + : city.population > 5000000 ? {size: 22, color: [255, 32, 0]} + : city.population > 2000000 ? {size: 20, color: [255, 64, 0]} + : city.population > 1000000 ? {size: 18, color: [255, 96, 0]} + : city.population > 500000 ? {size: 16, color: [255, 128, 0]} + : city.population > 200000 ? {size: 14, color: [255, 160, 0]} + : city.population > 100000 ? {size: 12, color: [255, 192, 0]} + : city.population > 50000 ? {size: 10, color: [255, 224, 0]} + : {size: 8, color: [255, 255, 0]}; return { alternativeNames: [], area: area, - countryCode: countryCode, + countryCode: city.country_code, editable: true, - flag: countryCode, - geoname: city.name + ', ' + Ox.getCountryByCode(countryCode).name, - geonameSort: getGeonameSort(city.name + ', ' + Ox.getCountryByCode(countryCode).name), + geoname: geoname, + geonameSort: getGeonameSort(geoname), id: Ox.encodeBase32(Ox.uid()), markerColor: marker.color, markerSize: marker.size, @@ -206,6 +203,5 @@ Ox.load('Geo', function() { } }); - -}); + }); \ No newline at end of file diff --git a/source/Ox.Geo/json/Ox.Geo.json b/source/Ox.Geo/json/Ox.Geo.json index b56f9790..43abaa20 100644 --- a/source/Ox.Geo/json/Ox.Geo.json +++ b/source/Ox.Geo/json/Ox.Geo.json @@ -213,21 +213,22 @@ "Norway", "United Kingdom" ], - "east": 180, + "east": 179.9999999999, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/6/68/Flag_of_the_Antarctic_Treaty.svg", - "lat": -72.52556439, + "lat": -72.5255643899, "lng": 0, "name": "Antarctica", "north": -60, "region": "Antarctica", - "south": -85.05112878, - "west": -180 + "south": -85.0511287798, + "west": -179.9999999999 }, { "area": 6372157701965.361, "code": "AR", "continent": "South America", - "dependecies": [ + "dependencies": [ + "Argentine Antarctica", "Antarctica" ], "east": -53.6497164, @@ -249,12 +250,12 @@ ], "east": -25, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_Tierra_del_Fuego_province_in_Argentina.svg", - "lat": -72.52556439, + "lat": -72.5255643899, "lng": -49.5, "name": "Argentine Antarctica", "north": -60, "region": "Antarctica", - "south": -85.05112878, + "south": -85.0511287798, "west": -74 }, { @@ -292,7 +293,14 @@ "area": 46223946776081.38, "code": "AU", "continent": "Oceania", - "dependecies": [ + "dependencies": [ + "Ashmore and Cartier Islands", + "Australian Antarctic Territory", + "Christmas Island", + "Cocos Islands", + "Coral Sea Islands", + "Heard Island and McDonald Islands", + "Norfolk Island", "Antarctica" ], "east": -173.0645, @@ -338,13 +346,13 @@ "east": 160, "flag": "AU", "flagURL": "http://upload.wikimedia.org/wikipedia/en/b/b9/Flag_of_Australia.svg", - "lat": -72.52556439, - "lng": 102.31666667, + "lat": -72.5255643899, + "lng": 102.3166666667, "name": "Australian Antarctic Territory", "north": -60, "region": "Antarctica", - "south": -85.05112878, - "west": 44.63333333 + "south": -85.0511287798, + "west": 44.6333333333 }, { "area": 60499860826.18157, @@ -651,7 +659,7 @@ "west": -69.64499 }, { - "area": 786222265.5974265, + "area": 368830818016.12, "code": "BQ", "continent": "South America", "created": { @@ -661,12 +669,12 @@ "dependency": [ "Netherlands" ], - "east": -68.1954002, + "east": -62.9457378, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/1/1e/Flag_of_Bonaire.svg", - "lat": 12.2018902, - "lng": -68.2623822, + "lat": 14.83740955, + "lng": -65.68335055, "name": "Bonaire, Sint Eustatius and Saba", - "north": 12.3122468, + "north": 17.6503149, "region": "Caribbean", "south": 12.0245042, "west": -68.4209633, @@ -681,12 +689,12 @@ ], "east": -20, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/f/fd/Flag_of_the_British_Antarctic_Territory.svg", - "lat": -72.52556439, + "lat": -72.5255643899, "lng": -50, "name": "British Antarctic Territory", "north": -60, "region": "Antarctica", - "south": -85.05112878, + "south": -85.0511287798, "west": -80 }, { @@ -987,7 +995,8 @@ "area": 16435911702619.027, "code": "CL", "continent": "South America", - "dependecies": [ + "dependencies": [ + "Chilean Antarctic Territory", "Antarctica" ], "east": -66.3327, @@ -1012,12 +1021,12 @@ ], "east": -53, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/8/8d/Flag_of_Magallanes%2C_Chile.svg", - "lat": -72.52556439, + "lat": -72.5255643899, "lng": -71.5, "name": "Chilean Antarctic Territory", "north": -60, "region": "Antarctica", - "south": -85.05112878, + "south": -85.0511287798, "west": -90 }, { @@ -1038,7 +1047,7 @@ "area": 21555709010335.66, "code": "CN", "continent": "Asia", - "dependecies": [ + "dependencies": [ "Hong Kong", "Macau" ], @@ -1111,7 +1120,7 @@ "west": -86.0449 }, { - "area": 280624359208.4667, + "area": 280624359208.4659, "code": "CSHH", "continent": "Europe", "dissolved": { @@ -1212,7 +1221,7 @@ "west": -25.3839111 }, { - "area": 1805549223.1433032, + "area": 5069459315.473289, "code": "CW", "continent": "South America", "created": { @@ -1222,15 +1231,15 @@ "dependency": [ "Netherlands" ], - "east": -68.7385368, + "east": -68.567, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/b/b1/Flag_of_Cura%C3%A7ao.svg", - "lat": 12.1224221, - "lng": -68.8824233, + "lat": 12.16957, + "lng": -68.99002, "name": "Cura\u00e7ao", - "north": 12.3916805, + "north": 12.4942, "region": "Caribbean", - "south": 12.0379775, - "west": -69.1600137 + "south": 11.9224, + "west": -69.299 }, { "area": 345831962.0301499, @@ -1403,7 +1412,7 @@ "area": 182677851891.08655, "code": "DK", "continent": "Europe", - "dependecies": [ + "dependencies": [ "Faroe Islands", "Greenland" ], @@ -1591,7 +1600,7 @@ "area": 1677389551125.249, "code": "ES", "continent": "Europe", - "dependecies": [ + "dependencies": [ "Canary Islands", "Ceuta and Melilla" ], @@ -1629,24 +1638,24 @@ "west": 32.9977343 }, { - "area": 31497506979520.023, + "area": 19047536573713.348, "code": "EU", "continent": "Europe", - "east": 74.1357, + "east": 34.6045, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/b/b7/Flag_of_Europe.svg", - "lat": 54.5259614, - "lng": 15.2551187, + "lat": 51.1908966, + "lng": 1.56985, "name": "European Union", - "north": 82.7021697, + "north": 70.0922932, "region": "Western Europe", - "south": 33.8978, - "west": -28.0371 + "south": 32.2895, + "west": -31.4648 }, { "area": 676332610065.4183, "code": "FI", "continent": "Europe", - "dependecies": [ + "dependencies": [ "\u00c5land" ], "east": 31.5871, @@ -1735,7 +1744,7 @@ "west": -7.7178955 }, { - "area": 12354685466247.986, + "area": 57945336234756.42, "code": "FQHH", "continent": "Antarctica", "dissolved": { @@ -1745,15 +1754,15 @@ "date": "1979", "dissolved": "split" }, - "east": 70.5761719, + "east": 142.1833333333, "flag": "TF", "flagURL": "http://upload.wikimedia.org/wikipedia/commons/a/a7/Flag_of_the_French_Southern_and_Antarctic_Lands.svg", - "lat": -30.6443971, - "lng": 55.12001645, + "lat": -48.3001768899, + "lng": 90.9235971666, "name": "French Southern and Antarctic Territories", "north": -11.549225, "region": "Antarctica", - "south": -49.7395692, + "south": -85.0511287798, "west": 39.663861, "wikipediaName": "French Southern and Antarctic Lands" }, @@ -1765,7 +1774,24 @@ "country": "Metropolitan France", "date": "1997" }, - "dependecies": [ + "dependencies": [ + "Ad\u00e9lie Land", + "Clipperton Island", + "French Afar and Issas", + "French Guiana", + "French Polynesia", + "French Southern and Antarctic Lands", + "French Southern Lands", + "Guadeloupe", + "Martinique", + "Mayotte", + "New Caledonia", + "R\u00e9union", + "Saint Barth\u00e9lemy", + "Saint Martin", + "Saint Pierre and Miquelon", + "Wallis and Futuna", + "Antarctica", "New Hebrides" ], "east": 9.6625, @@ -1790,16 +1816,16 @@ "dependency": [ "France" ], - "east": 142.18333333, + "east": 142.1833333333, "flag": "TF", "flagURL": "http://upload.wikimedia.org/wikipedia/commons/a/a7/Flag_of_the_French_Southern_and_Antarctic_Lands.svg", - "lat": -72.52556439, - "lng": 139.10833333, + "lat": -72.5255643899, + "lng": 139.1083333333, "name": "Ad\u00e9lie Land", "north": -60, "region": "Antarctica", - "south": -85.05112878, - "west": 136.03333333 + "south": -85.0511287798, + "west": 136.0333333333 }, { "area": 1277176367200.3474, @@ -1835,6 +1861,56 @@ "south": -4.1656, "west": 8.421 }, + { + "area": 805250615187.3992, + "code": "GB", + "continent": "Europe", + "dependencies": [ + "Canton and Enderbury Islands", + "Akrotiri and Dhekelia", + "Anguilla", + "Ascension", + "Bermuda", + "British Antarctic Territory", + "British Indian Ocean Territory", + "British Virgin Islands", + "Cayman Islands", + "Diego Garcia", + "England", + "Falkland Islands", + "Gibraltar", + "Gilbert and Ellice Islands", + "Guernsey", + "Isle of Man", + "Jersey", + "Montserrat", + "Northern Ireland", + "Pitcairn Islands", + "Saint Helena", + "Scotland", + "South Georgia and the South Sandwich Islands", + "Tristan da Cunha", + "Turks and Caicos Islands", + "Wales", + "Antarctica", + "New Hebrides" + ], + "east": 1.768926, + "flagURL": "http://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg", + "googleName": "UK", + "languages": [ + "Cornish", + "English", + "British" + ], + "lat": 55.3720906, + "lng": -3.4468685, + "name": "United Kingdom", + "north": 60.86165, + "region": "Northern Europe", + "south": 49.8825312, + "west": -8.662663 + }, { "area": 3777956357.769113, "code": "GB-AD", @@ -1874,29 +1950,6 @@ "south": 49.8825312, "west": -6.3651943 }, - { - "area": 805250615187.3992, - "code": "GB", - "continent": "Europe", - "dependecies": [ - "New Hebrides" - ], - "east": 1.768926, - "flagURL": "http://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg", - "googleName": "UK", - "languages": [ - "Cornish", - "English", - "British" - ], - "lat": 55.3720906, - "lng": -3.4468685, - "name": "United Kingdom", - "north": 60.86165, - "region": "Northern Europe", - "south": 49.8825312, - "west": -8.662663 - }, { "area": 25515326599.749855, "code": "GB-NIR", @@ -1992,24 +2045,24 @@ "wikipediaName": "Georgia (country)" }, { - "area": 84041059.04251076, + "area": 22763384174.018658, "code": "GE-AB", "continent": "Asia", "disputed": [ "Georgia" ], - "east": 20.2782257, + "east": 42.149976, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/2/27/Flag_of_Abkhazia.svg", "languages": [ "Abkhazian" ], - "lat": 46.95325, - "lng": 20.2010411, + "lat": 42.9737816, + "lng": 41.4421799, "name": "Abkhazia", - "north": 47.0002048, + "north": 43.584541, "region": "Western Asia", - "south": 46.9229997, - "west": 20.149517 + "south": 42.410732, + "west": 40.010239 }, { "area": 9503349203.032263, @@ -2028,45 +2081,6 @@ "south": 41.733082, "west": 43.419911 }, - { - "area": 139633328625.30426, - "code": "GF", - "continent": "South America", - "dependency": [ - "France" - ], - "east": -51.616449, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/2/29/Flag_of_French_Guiana.svg", - "lat": 3.933889, - "lng": -53.125782, - "name": "French Guiana", - "north": 5.9548, - "region": "Southern America", - "south": 2.109287, - "west": -54.554438 - }, - { - "area": 1344538103.59379, - "code": "GG", - "continent": "Europe", - "dependecies": [ - "Alderney", - "Herm", - "Sark" - ], - "dependency": [ - "United Kingdom" - ], - "east": -2.158902, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/f/fa/Flag_of_Guernsey.svg", - "lat": 49.465691, - "lng": -2.585278, - "name": "Guernsey", - "north": 49.731547, - "region": "Northern Europe", - "south": 49.407746, - "west": -2.675589 - }, { "area": 1302387826289.7786, "code": "GEHH", @@ -2092,6 +2106,45 @@ "south": -11.1891796, "west": 172.755768 }, + { + "area": 139633328625.30426, + "code": "GF", + "continent": "South America", + "dependency": [ + "France" + ], + "east": -51.616449, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/2/29/Flag_of_French_Guiana.svg", + "lat": 3.933889, + "lng": -53.125782, + "name": "French Guiana", + "north": 5.9548, + "region": "Southern America", + "south": 2.109287, + "west": -54.554438 + }, + { + "area": 1344538103.59379, + "code": "GG", + "continent": "Europe", + "dependencies": [ + "Alderney", + "Herm", + "Sark" + ], + "dependency": [ + "United Kingdom" + ], + "east": -2.158902, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/f/fa/Flag_of_Guernsey.svg", + "lat": 49.465691, + "lng": -2.585278, + "name": "Guernsey", + "north": 49.731547, + "region": "Northern Europe", + "south": 49.407746, + "west": -2.675589 + }, { "area": 19057140.93126722, "code": "GG-AL", @@ -2245,6 +2298,20 @@ "south": 15.742032, "west": -61.8468475 }, + { + "area": 387476388452.9188, + "code": "GQ", + "continent": "Africa", + "east": 11.3538886, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/3/31/Flag_of_Equatorial_Guinea.svg", + "lat": 1.650801, + "lng": 10.267895, + "name": "Equatorial Guinea", + "north": 3.8355, + "region": "Middle Africa", + "south": -1.5475, + "west": 5.5419 + }, { "area": 725852290757.8319, "code": "GR", @@ -2263,34 +2330,6 @@ "south": 34.5428, "west": 19.3098 }, - { - "area": 387476388452.9188, - "code": "GQ", - "continent": "Africa", - "east": 11.3538886, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/3/31/Flag_of_Equatorial_Guinea.svg", - "lat": 1.650801, - "lng": 10.267895, - "name": "Equatorial Guinea", - "north": 3.8355, - "region": "Middle Africa", - "south": -1.5475, - "west": 5.5419 - }, - { - "area": 203323658545.63513, - "code": "GT", - "continent": "South America", - "east": -88.1982, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/ec/Flag_of_Guatemala.svg", - "lat": 15.783471, - "lng": -90.230759, - "name": "Guatemala", - "north": 17.8156972, - "region": "Central America", - "south": 13.63, - "west": -92.2714 - }, { "area": 531522905979.8907, "code": "GS", @@ -2308,6 +2347,20 @@ "south": -59.910976, "west": -38.4301758 }, + { + "area": 203323658545.63513, + "code": "GT", + "continent": "South America", + "east": -88.1982, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/ec/Flag_of_Guatemala.svg", + "lat": 15.783471, + "lng": -90.230759, + "name": "Guatemala", + "north": 17.8156972, + "region": "Central America", + "south": 13.63, + "west": -92.2714 + }, { "area": 5446482335.020033, "code": "GU", @@ -2440,6 +2493,23 @@ "south": 17.9422, "west": -74.6082 }, + { + "area": 162790692682.90808, + "code": "HU", + "continent": "Europe", + "east": 22.8979924, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/c/c1/Flag_of_Hungary.svg", + "languages": [ + "Hungarian" + ], + "lat": 47.162494, + "lng": 19.503304, + "name": "Hungary", + "north": 48.585233, + "region": "Eastern Europe", + "south": 45.737124, + "west": 16.1136813 + }, { "area": 546015995630.9251, "code": "HVBF", @@ -2461,35 +2531,18 @@ "wikipediaName": "Republic of Upper Volta" }, { - "area": 162790692682.90808, - "code": "HU", - "continent": "Europe", - "east": 22.8979924, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/c/c1/Flag_of_Hungary.svg", - "languages": [ - "Hungarian" - ], - "lat": 47.162494, - "lng": 19.503304, - "name": "Hungary", - "north": 48.585233, - "region": "Eastern Europe", - "south": 45.737124, - "west": 16.1136813 - }, - { - "area": 2095460525988.537, + "area": 116270632971.66176, "code": "IC", "continent": "Africa", "dependency": [ "Spain" ], - "east": -2.1567972, + "east": -12.9987624, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/b/b0/Flag_of_the_Canary_Islands.svg", - "lat": 28.2915637, - "lng": -16.6291304, + "lat": 28.6736742, + "lng": -15.5797286, "name": "Canary Islands", - "north": 40.41292, + "north": 29.709598, "region": "Northern Africa", "south": 27.6377504, "west": -18.1606948 @@ -2549,11 +2602,28 @@ "south": 29.4797, "west": 34.267387 }, + { + "area": 1412207881.62399, + "code": "IM", + "continent": "Europe", + "dependency": [ + "United Kingdom" + ], + "east": -4.308328, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_the_Isle_of_Man.svg", + "lat": 54.236107, + "lng": -4.548056, + "name": "Isle of Man", + "north": 54.418247, + "region": "Northern Europe", + "south": 54.04464, + "west": -4.830181 + }, { "area": 9736416526088.582, "code": "IN", "continent": "Asia", - "dependecies": [ + "dependencies": [ "Jammu and Kashmir" ], "east": 97.395555, @@ -2583,21 +2653,21 @@ "west": 68.1097 }, { - "area": 1412207881.62399, - "code": "IM", - "continent": "Europe", + "area": 183577277217.56094, + "code": "IN-JK", + "continent": "Asia", "dependency": [ - "United Kingdom" + "India" ], - "east": -4.308328, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_the_Isle_of_Man.svg", - "lat": 54.236107, - "lng": -4.548056, - "name": "Isle of Man", - "north": 54.418247, - "region": "Northern Europe", - "south": 54.04464, - "west": -4.830181 + "east": 79.3058507, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/c/cd/Jammu-Kashmir-flag.svg", + "lat": 34.1490875, + "lng": 76.8259652, + "name": "Jammu and Kashmir", + "north": 35.5054275, + "region": "Southern Asia", + "south": 32.2922694, + "west": 73.750507 }, { "area": 40562687944.25631, @@ -2616,23 +2686,6 @@ "south": -7.4891118, "west": 71.1859131 }, - { - "area": 183577277217.56094, - "code": "IN-JK", - "continent": "Asia", - "dependency": [ - "India" - ], - "east": 79.3058507, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/c/cd/Jammu-Kashmir-flag.svg", - "lat": 34.1490875, - "lng": 76.8259652, - "name": "Jammu and Kashmir", - "north": 35.5054275, - "region": "Southern Asia", - "south": 32.2922694, - "west": 73.750507 - }, { "area": 848059568986.0635, "code": "IQ", @@ -2723,6 +2776,20 @@ "south": 49.164176, "west": -2.256745 }, + { + "area": 24005584843.571304, + "code": "JM", + "continent": "South America", + "east": -76.1448669, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/0a/Flag_of_Jamaica.svg", + "lat": 18.109581, + "lng": -77.297508, + "name": "Jamaica", + "north": 18.569782, + "region": "Caribbean", + "south": 17.6688854, + "west": -78.4073639 + }, { "area": 193288150235.7403, "code": "JO", @@ -2755,20 +2822,6 @@ "south": 23.9207972, "west": 122.91 }, - { - "area": 21202923962.90615, - "code": "JM", - "continent": "South America", - "east": -76.180321, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/0a/Flag_of_Jamaica.svg", - "lat": 18.115265, - "lng": -77.2734795, - "name": "Jamaica", - "north": 18.526976, - "region": "Caribbean", - "south": 17.703554, - "west": -78.366638 - }, { "area": 4566161.281369122, "code": "JTUM", @@ -2893,20 +2946,6 @@ "south": 17.0786101, "west": -62.86956 }, - { - "area": 333784532662.54047, - "code": "KP", - "continent": "Asia", - "east": 130.68865, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/5/51/Flag_of_North_Korea.svg", - "lat": 40.339852, - "lng": 127.510093, - "name": "North Korea", - "north": 43.01159, - "region": "Eastern Asia", - "south": 37.5892, - "west": 124.172937 - }, { "area": 681890094841.403, "code": "KOJP", @@ -2927,6 +2966,20 @@ "west": 124.172937, "wikipediaName": "Korean Empire" }, + { + "area": 333784532662.54047, + "code": "KP", + "continent": "Asia", + "east": 130.68865, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/5/51/Flag_of_North_Korea.svg", + "lat": 40.339852, + "lng": 127.510093, + "name": "North Korea", + "north": 43.01159, + "region": "Eastern Asia", + "south": 37.5892, + "west": 124.172937 + }, { "area": 371748242347.5363, "code": "KR", @@ -3742,7 +3795,7 @@ "area": 86514439152.23622, "code": "NL", "continent": "Europe", - "dependecies": [ + "dependencies": [ "Aruba", "Bonaire, Sint Eustatius and Saba", "Cura\u00e7ao", @@ -3766,7 +3819,11 @@ "area": 1956432609138.1396, "code": "NO", "continent": "Europe", - "dependecies": [ + "dependencies": [ + "Bouvet Island", + "Peter I Island", + "Queen Maud Land", + "Svalbard and Jan Mayen", "Antarctica" ], "east": 31.355, @@ -3824,15 +3881,15 @@ "dependency": [ "Norway" ], - "east": 44.63333333, + "east": 44.6333333333, "flag": "NO", "flagURL": "http://upload.wikimedia.org/wikipedia/commons/d/d9/Flag_of_Norway.svg", - "lat": -72.52556439, - "lng": 32.31666667, + "lat": -72.5255643899, + "lng": 32.3166666667, "name": "Queen Maud Land", "north": -60, "region": "Antarctica", - "south": -85.05112878, + "south": -85.0511287798, "west": 20 }, { @@ -3849,23 +3906,6 @@ "south": -0.5580623, "west": 166.9071293 }, - { - "area": 417793725.8031535, - "code": "NU", - "continent": "Oceania", - "dependency": [ - "New Zealand" - ], - "east": -169.7743249, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_Niue.svg", - "lat": -19.054445, - "lng": -169.867233, - "name": "Niue", - "north": -18.952625, - "region": "Polynesia", - "south": -19.1555668, - "west": -169.9500847 - }, { "area": 5015092056.758395, "code": "NTHH", @@ -3893,11 +3933,32 @@ "west": 44.712752, "wikipediaName": "Saudi-Iraqi neutral zone" }, + { + "area": 417793725.8031535, + "code": "NU", + "continent": "Oceania", + "dependency": [ + "New Zealand" + ], + "east": -169.7743249, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_Niue.svg", + "lat": -19.054445, + "lng": -169.867233, + "name": "Niue", + "north": -18.952625, + "region": "Polynesia", + "south": -19.1555668, + "west": -169.9500847 + }, { "area": 4261577771796.5947, "code": "NZ", "continent": "Oceania", - "dependecies": [ + "dependencies": [ + "Cook Islands", + "Niue", + "Ross Dependency", + "Tokelau", "Antarctica" ], "east": -175.0663205, @@ -3923,12 +3984,12 @@ "east": -150, "flag": "NZ", "flagURL": "http://upload.wikimedia.org/wikipedia/commons/3/3e/Flag_of_New_Zealand.svg", - "lat": -72.52556439, + "lat": -72.5255643899, "lng": -175, "name": "Ross Dependency", "north": -60, "region": "Antarctica", - "south": -85.05112878, + "south": -85.0511287798, "west": 160 }, { @@ -3959,6 +4020,34 @@ "south": 7.0409, "west": -83.0522411 }, + { + "area": 10121168791949.904, + "code": "PCHH", + "continent": "Oceania", + "dependency": [ + "United States" + ], + "dissolved": { + "country": [ + "Marshall Islands", + "Micronesia", + "Northern Mariana Islands", + "Palau" + ], + "date": "1986", + "dissolved": "split" + }, + "east": 172.5732422, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/4/41/Flag_of_the_Trust_Territory_of_the_Pacific_Islands.svg", + "lat": 10.4061473, + "lng": 152.2155762, + "name": "Pacific Islands", + "north": 20.6584862, + "region": "Micronesia", + "south": 0.1538084, + "west": 131.8579102, + "wikipediaName": "Trust Territory of the Pacific Islands" + }, { "area": 2855066440319.2007, "code": "PE", @@ -4010,34 +4099,6 @@ "south": -12.0823, "west": 140.8419695 }, - { - "area": 10121168791949.904, - "code": "PCHH", - "continent": "Oceania", - "dependency": [ - "United States" - ], - "dissolved": { - "country": [ - "Marshall Islands", - "Micronesia", - "Northern Mariana Islands", - "Palau" - ], - "date": "1986", - "dissolved": "split" - }, - "east": 172.5732422, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/4/41/Flag_of_the_Trust_Territory_of_the_Pacific_Islands.svg", - "lat": 10.4061473, - "lng": 152.2155762, - "name": "Pacific Islands", - "north": 20.6584862, - "region": "Micronesia", - "south": 0.1538084, - "west": 131.8579102, - "wikipediaName": "Trust Territory of the Pacific Islands" - }, { "area": 2205280531223.852, "code": "PH", @@ -4061,7 +4122,7 @@ "area": 2433685651116.017, "code": "PK", "continent": "Asia", - "dependecies": [ + "dependencies": [ "Azad Kashmir", "Gilgit-Baltistan" ], @@ -4216,6 +4277,29 @@ "south": 32.2895, "west": -31.4648 }, + { + "area": 1402280935471.6604, + "code": "PUUM", + "continent": "Oceania", + "dependency": [ + "United States" + ], + "dissolved": { + "country": "United States Minor Outlying Islands", + "date": "1986", + "dissolved": "merged" + }, + "east": -160.004578, + "flag": "US", + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e2/Flag_of_the_United_States_%28Pantone%29.svg", + "lat": 3.0220885, + "lng": -168.3145555, + "name": "United States Miscellaneous Pacific Islands", + "north": 6.433183, + "region": "Polynesia", + "south": -0.389006, + "west": -176.624533 + }, { "area": 161269956913.75598, "code": "PW", @@ -4273,29 +4357,6 @@ "south": 8.9294817, "west": -80.0232967 }, - { - "area": 1402280935471.6604, - "code": "PUUM", - "continent": "Oceania", - "dependency": [ - "United States" - ], - "dissolved": { - "country": "United States Minor Outlying Islands", - "date": "1986", - "dissolved": "merged" - }, - "east": -160.004578, - "flag": "US", - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e2/Flag_of_the_United_States_%28Pantone%29.svg", - "lat": 3.0220885, - "lng": -168.3145555, - "name": "United States Miscellaneous Pacific Islands", - "north": 6.433183, - "region": "Polynesia", - "south": -0.389006, - "west": -176.624533 - }, { "area": 18688837753.055202, "code": "QA", @@ -4516,6 +4577,24 @@ "south": 1.2015, "west": 103.6012 }, + { + "area": 2899291545265.023, + "code": "SH", + "continent": "Africa", + "dependency": [ + "United Kingdom" + ], + "east": -5.6786442, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Saint_Helena.svg", + "lat": -22.52888935, + "lng": -10.05107405, + "name": "Saint Helena", + "north": -7.8876128, + "region": "Western Africa", + "south": -37.1701659, + "west": -14.4235039, + "wikipediaName": "Saint Helena, Ascension and Tristan da Cunha" + }, { "area": 40411341662.19755, "code": "SI", @@ -4556,24 +4635,6 @@ "south": 5.612787, "west": 97.343396 }, - { - "area": 2899291545265.023, - "code": "SH", - "continent": "Africa", - "dependency": [ - "United Kingdom" - ], - "east": -5.6786442, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Saint_Helena.svg", - "lat": -22.52888935, - "lng": -10.05107405, - "name": "Saint Helena", - "north": -7.8876128, - "region": "Western Africa", - "south": -37.1701659, - "west": -14.4235039, - "wikipediaName": "Saint Helena, Ascension and Tristan da Cunha" - }, { "area": 1450540754767.253, "code": "SJ", @@ -4764,6 +4825,44 @@ "south": -0.0988769, "west": 6.328125 }, + { + "area": 50536546494694.38, + "code": "SUHH", + "continent": "Europe", + "dependencies": [ + "Byelorussian Soviet Socialist Republic" + ], + "dissolved": { + "country": [ + "Armenia", + "Azerbaijan", + "Belarus", + "Estonia", + "Georgia", + "Kazakhstan", + "Kyrgyzstan", + "Latvia", + "Lithuania", + "Moldova", + "Russia", + "Tajikistan", + "Turkmenistan", + "Ukraine", + "Uzbekistan" + ], + "date": "1991-12-21", + "dissolved": "split" + }, + "east": -168.97788, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/a/a9/Flag_of_the_Soviet_Union.svg", + "lat": 58.64807535, + "lng": 105.31911, + "name": "Soviet Union", + "north": 82.1673907, + "region": "Eastern Europe", + "south": 35.12876, + "west": 19.6161 + }, { "area": 42613483960.324196, "code": "SV", @@ -4779,7 +4878,7 @@ "west": -90.1923 }, { - "area": 201201483.311003, + "area": 100968986.84106876, "code": "SX", "continent": "South America", "created": { @@ -4789,15 +4888,15 @@ "dependency": [ "Netherlands" ], - "east": -63.0101323, + "east": -62.9996466, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/d/d3/Flag_of_Sint_Maarten.svg", - "lat": 18.0525921, - "lng": -63.0736329, + "lat": 18.03748405, + "lng": -63.0665588, "name": "Sint Maarten", - "north": 18.1243792, + "north": 18.0695, "region": "Caribbean", - "south": 18.0052232, - "west": -63.1534588 + "south": 18.0054681, + "west": -63.133471 }, { "area": 343571142589.864, @@ -4879,13 +4978,13 @@ "west": 13.47 }, { - "area": 12354685466247.986, + "area": 15161411044199.537, "code": "TF", "continent": "Antarctica", - "east": 70.5761719, + "east": 77.598801, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/a/a7/Flag_of_the_French_Southern_and_Antarctic_Lands.svg", "lat": -30.6443971, - "lng": 55.12001645, + "lng": 58.631331, "name": "French Southern Territories", "north": -11.549225, "region": "Antarctica", @@ -4945,44 +5044,6 @@ "south": 36.6719898, "west": 67.342012 }, - { - "area": 50536546494694.38, - "code": "SUHH", - "continent": "Europe", - "dependecies": [ - "Byelorussian Soviet Socialist Republic" - ], - "dissolved": { - "country": [ - "Armenia", - "Azerbaijan", - "Belarus", - "Estonia", - "Georgia", - "Kazakhstan", - "Kyrgyzstan", - "Latvia", - "Lithuania", - "Moldova", - "Russia", - "Tajikistan", - "Turkmenistan", - "Ukraine", - "Uzbekistan" - ], - "date": "1991-12-21", - "dissolved": "split" - }, - "east": -168.97788, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/a/a9/Flag_of_the_Soviet_Union.svg", - "lat": 58.64807535, - "lng": 105.31911, - "name": "Soviet Union", - "north": 82.1673907, - "region": "Eastern Europe", - "south": 35.12876, - "west": 19.6161 - }, { "area": 20824442478.024734, "code": "TK", @@ -5201,11 +5262,40 @@ "west": 29.5734335 }, { + "area": 805250615187.3992, "code": "UK", "continent": "Europe", - "dependecies": [ + "dependencies": [ + "Canton and Enderbury Islands", + "Akrotiri and Dhekelia", + "Anguilla", + "Ascension", + "Bermuda", + "British Antarctic Territory", + "British Indian Ocean Territory", + "British Virgin Islands", + "Cayman Islands", + "Diego Garcia", + "England", + "Falkland Islands", + "Gibraltar", + "Gilbert and Ellice Islands", + "Guernsey", + "Isle of Man", + "Jersey", + "Montserrat", + "Northern Ireland", + "Pitcairn Islands", + "Saint Helena", + "Scotland", + "South Georgia and the South Sandwich Islands", + "Tristan da Cunha", + "Turks and Caicos Islands", + "Wales", + "Antarctica", "New Hebrides" ], + "east": 1.768926, "flag": "GB", "flagURL": "http://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg", "googleName": "UK", @@ -5214,14 +5304,42 @@ "English", "British" ], + "lat": 55.3720906, + "lng": -3.4468685, "name": "United Kingdom", - "region": "Northern Europe" + "north": 60.86165, + "region": "Northern Europe", + "south": 49.8825312, + "west": -8.662663 + }, + { + "area": 11440133137495.588, + "code": "UM", + "continent": "Oceania", + "created": { + "country": "United States Miscellaneous Pacific Islands", + "date": "1986" + }, + "dependency": [ + "United States" + ], + "east": -160.004578, + "flag": "US", + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e2/Flag_of_the_United_States_%28Pantone%29.svg", + "lat": 14.0045105, + "lng": -176.7056275, + "name": "United States Minor Outlying Islands", + "north": 28.398027, + "region": "Polynesia", + "south": -0.389006, + "west": 166.593323 }, { "area": 54513363881268.82, "code": "US", "continent": "North America", - "dependecies": [ + "dependencies": [ + "Canton and Enderbury Islands", "American Samoa", "Guam", "Northern Mariana Islands", @@ -5321,28 +5439,6 @@ "south": 12.5143467, "west": -61.4863586 }, - { - "area": 11440133137495.588, - "code": "UM", - "continent": "Oceania", - "created": { - "country": "United States Miscellaneous Pacific Islands", - "date": "1986" - }, - "dependency": [ - "United States" - ], - "east": -160.004578, - "flag": "US", - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e2/Flag_of_the_United_States_%28Pantone%29.svg", - "lat": 14.0045105, - "lng": -176.7056275, - "name": "United States Minor Outlying Islands", - "north": 28.398027, - "region": "Polynesia", - "south": -0.389006, - "west": 166.593323 - }, { "area": 518541154303.11127, "code": "VDVN", @@ -5432,6 +5528,25 @@ "south": 8.1952, "west": 102.14441 }, + { + "area": 532650571566.48315, + "code": "VNVN", + "continent": "Asia", + "dissolved": { + "country": "Vietnam", + "date": "1976-07-02", + "dissolved": "merged" + }, + "east": 109.464638, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e9/Flag_of_South_Vietnam.svg", + "lat": 12.3176275, + "lng": 106.6478235, + "name": "South Vietnam", + "north": 16.225432, + "region": "South-Eastern Asia", + "south": 8.409823, + "west": 103.831009 + }, { "area": 407416223831.0918, "code": "VU", @@ -5464,26 +5579,7 @@ "west": -178.2284546 }, { - "area": 425920090297.6676, - "code": "VNVN", - "continent": "Asia", - "dissolved": { - "country": "Vietnam", - "date": "1976-07-02", - "dissolved": "merged" - }, - "east": 108.335793, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e9/Flag_of_South_Vietnam.svg", - "lat": 12.3176275, - "lng": 106.083401, - "name": "South Vietnam", - "north": 16.225432, - "region": "South-Eastern Asia", - "south": 8.409823, - "west": 103.831009 - }, - { - "area": 85141.62541359763, + "area": 39405128.03020904, "code": "WKUM", "continent": "Oceania", "dependency": [ @@ -5494,15 +5590,15 @@ "date": "1986", "dissolved": "merged" }, - "east": 166.65162678, + "east": 166.660066, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/4/47/Flag_of_Wake_Island.svg", - "lat": 19.2819444, - "lng": 166.6502778, + "lat": 19.2912744, + "lng": 166.6499348, "name": "Wake Island", - "north": 19.28329338, + "north": 19.320169, "region": "Micronesia", - "south": 19.28059542, - "west": 166.64892882 + "south": 19.26969, + "west": 166.593323 }, { "area": 11220955906.920902, @@ -5541,24 +5637,6 @@ "west": 20.014284, "wikipediaName": "Republic of Kosovo" }, - { - "area": 1115275612987.1345, - "code": "YE", - "continent": "Asia", - "created": { - "country": "South Yemen", - "date": "1990-05-22" - }, - "east": 54.679, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/8/89/Flag_of_Yemen.svg", - "lat": 15.552727, - "lng": 48.516388, - "name": "Yemen", - "north": 19, - "region": "Western Asia", - "south": 11.7975, - "west": 41.7096 - }, { "area": 730804782736.0583, "code": "YDYE", @@ -5578,6 +5656,44 @@ "south": 12.591311, "west": 43.513451 }, + { + "area": 1115275612987.1345, + "code": "YE", + "continent": "Asia", + "created": { + "country": "South Yemen", + "date": "1990-05-22" + }, + "east": 54.679, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/8/89/Flag_of_Yemen.svg", + "lat": 15.552727, + "lng": 48.516388, + "name": "Yemen", + "north": 19, + "region": "Western Asia", + "south": 11.7975, + "west": 41.7096 + }, + { + "area": 241456152948.5633, + "code": "YEYE", + "continent": "Asia", + "dissolved": { + "country": "Yemen", + "date": "1990-05-22", + "dissolved": "merged" + }, + "east": 47.008731, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/f/f6/Flag_of_North_Yemen.svg", + "lat": 15.0191335, + "lng": 44.8934835, + "name": "North Yemen", + "north": 17.404171, + "region": "Western Asia", + "south": 12.634096, + "west": 42.778236, + "wikipediaName": "Yemen Arab Republic" + }, { "area": 1821566334.0016134, "code": "YT", @@ -5596,30 +5712,32 @@ "west": 44.9914169 }, { - "area": 194910758261.49622, - "code": "YEYE", - "continent": "Asia", + "area": 519930340116.9752, + "code": "YUCS", + "continent": "Europe", "dissolved": { - "country": "Yemen", - "date": "1990-05-22", - "dissolved": "merged" + "country": "Serbia and Montenegro", + "date": "2003-02-04", + "dissolved": "renamed" }, - "east": 47.008731, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/f/f6/Flag_of_North_Yemen.svg", - "lat": 15.47490965, - "lng": 44.8934835, - "name": "North Yemen", - "north": 17.404171, - "region": "Western Asia", - "south": 13.5456483, - "west": 42.778236, - "wikipediaName": "Yemen Arab Republic" + "east": 23.034093, + "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e7/Flag_of_the_Kingdom_of_Yugoslavia.svg", + "languages": [ + "Serbo-Croatian" + ], + "lat": 43.86593435, + "lng": 18.1994965, + "name": "Yugoslavia", + "north": 46.8766467, + "region": "Southern Europe", + "south": 40.855222, + "west": 13.3649 }, { - "area": 2338673347483.4565, + "area": 2338673347483.458, "code": "ZA", "continent": "Africa", - "dependecies": [ + "dependencies": [ "Bophuthatswana", "Ciskei", "Transkei", @@ -5673,28 +5791,6 @@ "south": -13.459035, "west": 12.1454 }, - { - "area": 519930340116.9752, - "code": "YUCS", - "continent": "Europe", - "dissolved": { - "country": "Serbia and Montenegro", - "date": "2003-02-04", - "dissolved": "renamed" - }, - "east": 23.034093, - "flagURL": "http://upload.wikimedia.org/wikipedia/commons/e/e7/Flag_of_the_Kingdom_of_Yugoslavia.svg", - "languages": [ - "Serbo-Croatian" - ], - "lat": 43.86593435, - "lng": 18.1994965, - "name": "Yugoslavia", - "north": 46.8766467, - "region": "Southern Europe", - "south": 40.855222, - "west": 13.3649 - }, { "area": 624153359139.742, "code": "ZW", diff --git a/source/Ox.Geo/png/flags/16/IN.png b/source/Ox.Geo/png/flags/16/IN.png index bf111743..c78dd77c 100644 Binary files a/source/Ox.Geo/png/flags/16/IN.png and b/source/Ox.Geo/png/flags/16/IN.png differ diff --git a/source/Ox.Geo/png/flags/256/IN.png b/source/Ox.Geo/png/flags/256/IN.png index cc1d1ae9..e5cbff0f 100644 Binary files a/source/Ox.Geo/png/flags/256/IN.png and b/source/Ox.Geo/png/flags/256/IN.png differ diff --git a/source/Ox.Geo/png/flags/64/IN.png b/source/Ox.Geo/png/flags/64/IN.png index 1c48f89c..21b390c7 100644 Binary files a/source/Ox.Geo/png/flags/64/IN.png and b/source/Ox.Geo/png/flags/64/IN.png differ diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 7a730f37..aa35c332 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -58,7 +58,7 @@ Ox.ListMap = function(options, self) { format: function(value, data) { return $('') .attr({ - src: Ox.getFlagByGeoname(data.name, 16) + src: Ox.getFlagByGeoname(data.geoname, 16) }) .css({ width: '14px', diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 2805d7f4..5d58e30b 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -840,10 +840,10 @@ Ox.Map = function(options, self) { self.places = []; if (!self.isAsync) { - self.options.places.forEach(function(place, i) { - self.places[i] = new Ox.MapPlace(Ox.extend({ + self.options.places.forEach(function(place) { + self.places.push(new Ox.MapPlace(Ox.extend({ map: that - }, place)); + }, place))); }); } google.maps.event.trigger(self.map, 'resize'); diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index 0d004c76..dc987223 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -206,15 +206,15 @@ Ox.MapMarker = function(options) { //Ox.Log('Map', 'setOptions, that.map: ', that.map) if (that.map.options('showTypes')) { that.color = typeColor[that.place.type]; - that.size = 8; - Ox.forEach(areaSize, function(size, area) { - if (that.place.area > area) { - that.size = size; - } else { - return false; - } - }); } + that.size = 8; + Ox.forEach(areaSize, function(size, area) { + if (that.place.area > area) { + that.size = size; + } else { + return false; + } + }); that.marker.setOptions({ // fixme: cursor remains pointer cursor: that.place.editing ? 'move' : 'pointer', diff --git a/tools/geo/js/geo.js b/tools/geo/js/geo.js index 7add3a9d..62fd657e 100644 --- a/tools/geo/js/geo.js +++ b/tools/geo/js/geo.js @@ -1,44 +1,46 @@ Ox.load('UI', function() { - Ox.getJSONC('../jsonc/countries.jsonc', function(geo) { - - var $map = $('') - .attr({ - id: 'map', - src: '../png/map.png' - }), - $bar = Ox.Bar({size: 24}), - $status = $('
') - .css({margin: '5px 0 0 8px'}) - .appendTo($bar) - $panel = Ox.SplitPanel({ - elements: [ - { - element: $map - }, - { - element: $bar, - size: 24 - } - ], - orientation: 'vertical' - }) - .appendTo(Ox.UI.$body), - errors = [], - geocoder = new google.maps.Geocoder(), - json = [], - timeout = 2000; + Ox.getJSONC('../jsonc/countries.jsonc', function(data) { Ox.getJSON('../json/countries.json', function(countries) { - var length = countries.length; - callGetData(); - function callGetData() { - getData(countries.shift(), function(country) { + + var $map = $('') + .attr({ + id: 'map', + src: '../png/map.png' + }), + $bar = Ox.Bar({size: 24}), + $status = $('
') + .css({margin: '5px 0 0 8px'}) + .appendTo($bar), + $panel = Ox.SplitPanel({ + elements: [ + { + element: $map + }, + { + element: $bar, + size: 24 + } + ], + orientation: 'vertical' + }) + .appendTo(Ox.UI.$body), + errors = [], + geocoder = new google.maps.Geocoder(), + json = [], + length = countries.length, + timeout = 2000; + + getNextCountry(); + + function getNextCountry() { + getCountryData(countries.shift(), function(country) { addFlag(country); json.push(country); $status.html(json.length + '/' + length + ' ' + country.name); if (countries.length) { - setTimeout(callGetData, timeout); + setTimeout(getNextCountry, timeout); } else { var $dialog = Ox.Dialog({ buttons: [ @@ -58,200 +60,179 @@ Ox.load('UI', function() { WebkitUserSelect: 'text' }) .html( - '
' + JSON.stringify(json, null, 4) + '
' + '
' + JSON.stringify(
+                                            errors.length ? {errors: errors, data: json} : json,
+                                        null, 4) + '
' ), height: window.innerHeight * 0.9 - 48, title: 'Ox.Geo', width: window.innerWidth * 0.9 }).open(); - Ox.print('Errors:', errors); - $status.html( - errors.length - ? 'Done, see console for errors.' - : 'Done, no errors.' - ); + $status.html(''); } }); } - }); - function addFlag(country) { - var $div, - center = Ox.getXYByLatLng({lat: country.lat, lng: country.lng}), - crossesDateline = country.west > country.east, - height = $map.height(), - northEast = Ox.getXYByLatLng({lat: country.north, lng: country.east}), - southWest = Ox.getXYByLatLng({lat: country.south, lng: country.west}), - width = $map.width(); - if (crossesDateline) { - $div = [ - $('
') - .addClass('rect') - .css({ - left: '-16px', - top: (height * northEast.y) + 'px', - right: (width - width * northEast.x) + 'px', - bottom: (height - height * southWest.y) + 'px', - }) - .hide() - .appendTo(Ox.UI.$body), - $('
') - .addClass('rect') - .css({ - left: (width * southWest.x) + 'px', - top: (height * northEast.y) + 'px', - right: '-16px', - bottom: (height - height * southWest.y) + 'px', - }) - .hide() - .appendTo(Ox.UI.$body), - - ]; - } else { - $div = [ - $('
') - .addClass('rect') - .css({ - left: ($map.width() * southWest.x) + 'px', - top: ($map.height() * northEast.y) + 'px', - right: ($map.width() - $map.width() * northEast.x) + 'px', - bottom: ($map.height() - $map.height() * southWest.y) + 'px', - }) - .hide() - .appendTo(Ox.UI.$body) - ]; + function addFlag(country) { + var $div, + center = Ox.getXYByLatLng({lat: country.lat, lng: country.lng}), + crossesDateline = country.west > country.east, + height = $map.height(), + northEast = Ox.getXYByLatLng({lat: country.north, lng: country.east}), + southWest = Ox.getXYByLatLng({lat: country.south, lng: country.west}), + width = $map.width(); + if (crossesDateline) { + $div = [ + $('
') + .addClass('rect') + .css({ + left: '-16px', + top: (height * northEast.y) + 'px', + right: (width - width * northEast.x) + 'px', + bottom: (height - height * southWest.y) + 'px', + }) + .hide() + .appendTo(Ox.UI.$body), + $('
') + .addClass('rect') + .css({ + left: (width * southWest.x) + 'px', + top: (height * northEast.y) + 'px', + right: '-16px', + bottom: (height - height * southWest.y) + 'px', + }) + .hide() + .appendTo(Ox.UI.$body) + ]; + } else { + $div = [ + $('
') + .addClass('rect') + .css({ + left: ($map.width() * southWest.x) + 'px', + top: ($map.height() * northEast.y) + 'px', + right: ($map.width() - $map.width() * northEast.x) + 'px', + bottom: ($map.height() - $map.height() * southWest.y) + 'px', + }) + .hide() + .appendTo(Ox.UI.$body) + ]; + } + $('') + .attr({ + src: '../png/icons/16/' + country.code + '.png', + title: country.name + }) + .addClass('flag') + .css({ + left: (center.x * 100) + '%', + top: (center.y * 100) + '%' + }) + .mouseenter(function() { + $(this).css({ + zIndex: Ox.uid() + }); + $.each($div, function() { + $(this).show(); + }); + }) + .mouseleave(function() { + $.each($div, function() { + $(this).hide(); + }); + }) + .appendTo(Ox.UI.$body); } - $('') - .attr({ - src: '../png/icons/16/' + country.code + '.png', - title: country.name + ' ((' + country.south + ", " + country.west + "), (" + country.north + ", " + country.east + "))" - }) - .addClass('flag') - .css({ - left: (center.x * 100) + '%', - top: (center.y * 100) + '%' - }) - .mouseenter(function() { - $(this).css({ - zIndex: Ox.uid() - }); - $.each($div, function() { - $(this).show(); - }); - }) - .mouseleave(function() { - $.each($div, function() { - $(this).hide(); - }); - }) - .appendTo(Ox.UI.$body); - } - function geocode(address, country, callback) { - var bounds; - if (!Ox.isUndefined(country.north)) { - bounds = new google.maps.LatLngBounds( - new google.maps.LatLng(country.south, country.west), - new google.maps.LatLng(country.north, country.east) - ); - callback({ - bounds: bounds, - location: bounds.getCenter() - }); - } else { - geocoder.geocode({ - language: 'en', - address: address - }, function(results, status) { - if (results && results.length) { - var result = results[0]; - callback({ - bounds: result.geometry.bounds || result.geometry.viewport, - location: result.geometry.location - }) - } else { - errors.push([address, status]) - callback(null); - } - }); - } - } - - function getData(country, callback) { - if (country.lat) { - callback(country); - return; - } - var addresses = geo.geocode[country.name] || [country.name], - length = addresses.length, - union; - getImageURLs(country, function(imageURLs) { - // this might be too much data - /* - Ox.extend(country, { - imageURLs: imageURLs - }); - */ - callGeocode(); - }); - function callGeocode() { - geocode(addresses.shift(), country, function(data) { - var center, lat, lng, - northEast, southWest, - east, north, south, west; - if (data) { - union = !union ? data.bounds : union.union(data.bounds); - if (addresses.length == 0) { - if (length == 1) { - lat = data.location.lat(); - lng = data.location.lng(); - } else { - center = union.getCenter(); - lat = center.lat(); - lng = center.lng(); - } - northEast = union.getNorthEast(); - southWest = union.getSouthWest(); - east = northEast.lng(); - north = northEast.lat(); - south = southWest.lat(); - west = southWest.lng(); - callback($.extend(country, { - area: Ox.getArea( - {lat: south, lng: west}, - {lat: north, lng: east} - ), - east: toFixed(east), - lat: toFixed(lat), - lng: toFixed(lng), - north: toFixed(north), - south: toFixed(south), - west: toFixed(west) - })); + function geocode(geoname, callback) { + var bounds, location = data.location[geoname]; + if (location) { + bounds = new google.maps.LatLngBounds( + new google.maps.LatLng(location.south, location.west), + new google.maps.LatLng(location.north, location.east) + ); + callback({ + bounds: bounds, + location: bounds.getCenter() + }); + } else { + geocoder.geocode({ + language: 'en', + address: geoname + }, function(results, status) { + if (results && results.length) { + var result = results[0]; + callback({ + bounds: result.geometry.bounds || result.geometry.viewport, + location: result.geometry.location + }) + } else { + errors.push({geoname: geoname, status: status}); + Ox.print('remove this print statement', errors) + callback(null); } - } else { - callback(country); - } - }); - if (addresses.length) { - setTimeout(callGeocode, timeout); + }); } } - } - function getImageURLs(country, callback) { - var image = new Image(); - image.onload = function() { - callback({ - icon16: Ox.canvas(image).canvas.toDataURL() - }); - }; - image.src = '../png/icons/16/' + country.code + '.png'; - } + function getCountryData(country, callback) { - function toFixed(num) { - return parseFloat(num.toFixed(8)); - } + var geonames = Ox.clone(data.geocode[country.name]) || [country.name], + length = geonames.length, + union; + getNextGeoname(); + + function getNextGeoname() { + geocode(geonames.shift(), function(geodata) { + var center, lat, lng, + northEast, southWest, + east, north, south, west; + if (geodata) { + union = !union ? geodata.bounds : union.union(geodata.bounds); + } + if (geonames.length) { + setTimeout(getNextGeoname, timeout); + } else { + if (union) { + if (length == 1) { + lat = geodata.location.lat(); + lng = geodata.location.lng(); + } else { + center = union.getCenter(); + lat = center.lat(); + lng = center.lng(); + } + northEast = union.getNorthEast(); + southWest = union.getSouthWest(); + east = northEast.lng(); + north = northEast.lat(); + south = southWest.lat(); + west = southWest.lng(); + country = Ox.extend(country, { + area: Ox.getArea( + {lat: south, lng: west}, + {lat: north, lng: east} + ), + east: toFixed(east), + lat: toFixed(lat), + lng: toFixed(lng), + north: toFixed(north), + south: toFixed(south), + west: toFixed(west) + }); + } + callback(country); + } + }); + } + + } + + function toFixed(num) { + return parseFloat(num.toFixed(10)); + } + + }); }); diff --git a/tools/geo/jsonc/countries.jsonc b/tools/geo/jsonc/countries.jsonc index c85890e7..c74a020e 100644 --- a/tools/geo/jsonc/countries.jsonc +++ b/tools/geo/jsonc/countries.jsonc @@ -380,27 +380,26 @@ ], "geocode": { // construction of countries unknown to the google maps geocoder + "Abkhazia": ["Abkhazia, Georgia"], "Akrotiri and Dhekelia": ["Akrotiri, Cyprus", "Dhekelia, Cyprus"], - "Bonaire, Saint Eustatius and Saba": ["Bonaire", "Saba, Netherlands Antilles", "Saint Eustatius"], + "Bonaire, Sint Eustatius and Saba": ["Bonaire", "Saba", "Sint Eustatius"], "Byelorussian Soviet Socialist Republic": ["Belarus"], + "Canary Islands": ["Ferro, Canary Islands", "Isla Alegranza, Canary Islands"], "Canton and Enderbury Islands": ["Canton Island", "Enderbury Island"], "Ceuta and Melilla": ["Ceuta", "Melilla"], - "Curaçao": ["Banda Abou, Curaçao"], "Czechoslovakia": ["Czech Republic", "Slovakia"], - "East Germany": [ - "Mecklenburg Vorpommern", "Saxony", "Thuringia" - ], + "East Germany": ["Mecklenburg Vorpommern", "Saxony", "Thuringia"], "Dahomey": ["Benin"], - "European Union": ["Europe"], + "European Union": ["Cyprus", "Finland", "Greece", "Portugal"], "French Afar and Issas": ["Djibouti"], // see http://en.wikipedia.org/wiki/French_Southern_and_Antarctic_Lands // and http://en.wikipedia.org/wiki/Scattered_Islands_in_the_Indian_Ocean - "French Southern and Antarctic Territories": ["Adélie Land", "Bassas da India", "Glorioso Islands", "Île Kerguelen"], - "French Southern Territories": ["Bassas da India", "Glorioso Islands", "Île Kerguelen"], + "French Southern and Antarctic Territories": ["Adélie Land", "Bassas da India", "Glorioso Islands"], + "French Southern Territories": ["Amsterdam Island", "Bassas da India", "Glorioso Islands", "Kerguelen Island"], "Georgia": ["Georgia, Asia"], // see http://en.wikipedia.org/wiki/Gilbert_Islands "Gilbert and Ellice Islands": ["Arorae, Kiribati", "Butaritari, Kiribati", "Makin, Kiribati", "Tuvalu"], - "Jamaica": ["Clarendon Parish, Jamaica", "St. James Parish, Jamaica", "St. Thomas Parish, Jamaica", "Westmoreland Parish, Jamaica"], // in case results are us-biased + // "Jamaica": ["Clarendon Parish, Jamaica", "St. James Parish, Jamaica", "St. Thomas Parish, Jamaica", "Westmoreland Parish, Jamaica"], // in case results are us-biased "Jammu and Kashmir": ["Jammu and Kashmir, India"], "Johnston Island": ["Johnston Atoll"], "Korea": ["North Korea", "South Korea"], @@ -409,7 +408,7 @@ "Neutral Zone": ["39944, Saudi Arabia", "76611, Saudi Arabia"], "New Hebrides": ["Vanuatu"], "North Vietnam": ["Ha Giang Province, Vietnam", "Lai Chau Province, Vietnam", "Thua Thien-Hue Province, Vietnam"], - "North Yemen": ["Al Jawf, Yemen", "Hajjah, Yemen", "Ta'izz, Yemen"], + "North Yemen": ["Al Jawf, Yemen", "Hajjah, Yemen", "Ta'izz Province, Yemen"], "Northern Cyprus": ["Karpass, Cyprus", "Kokkina, Cyprus", "Lympia, Cyprus"], "Pacific Islands": ["Marshall Islands", "Micronesia", "Northern Mariana Islands", "Palau"], // "Palestine": ["71, Israel", "El-arish Rafah, Egypt"], @@ -419,21 +418,21 @@ "San Marino": ["San Marino, Europe"], // in case results are us-biased "Serbia and Montenegro": ["Montenegro", "Serbia"], "Siam": ["Thailand"], - "Sint Maarten": ["Sint Maarten, Netherlands Antilles"], + "Sint Maarten": ["Great Bay, Sint Maarten", "Oyster Pond, Sint Maarten", "Simpson Bay Lagoon, Sint Maarten"], "South Ossetia": ["Shida Kartli"], // see http://en.wikipedia.org/wiki/Sudan#States_and_regions // "South Sudan": [ // "Central Equatoria, Sudan", "Eastern Equatoria, Sudan", "Jonglei, Sudan", "Lakes, Sudan", "Northern Bahr el Ghazal, Sudan", // "Upper Nile, Sudan", "Unity, Sudan", "Warrap, Sudan", "Western Bahr el Ghazal, Sudan", "Western Equatoria, Sudan" // ], - "South Vietnam": ["Ca Mau Province, Vietnam", "Da Nang Province, Vietnam", "Kiên Giang Province, Vietnam"], + "South Vietnam": ["Ca Mau Province, Vietnam", "Da Nang Province, Vietnam", "Khanh Hoa Province, Vietnam", "Kien Giang Province, Vietnam"], "South Yemen": ["Al-Mahrah, Yemen", "Lahij, Yemen"], "Soviet Union": [ "Armenia", "Azerbaijan", "Belarus", "Estonia", "Georgia, Europe", "Latvia", "Lithuania", "Kazakhstan", "Kyrgyzstan", "Moldova", "Russia", "Tajikistan", "Turkmenistan", "Ukraine", "Uzbekistan" ], - "United Kingdom": ["England", "Northern Ireland", "Scotland", "Wales, United Kingdom"], + "United Kingdom": ["England", "Northern Ireland", "Scotland"], "United States Minor Outlying Islands": [ "Baker Island, UM", "Howland Island", "Jarvis Island", "Johnston Atoll", "Kingman Reef", "Midway Islands", "Palmyra Atoll", "Wake Island" @@ -442,9 +441,7 @@ "United States Miscellaneous Pacific Islands": [ "Baker Island, UM", "Howland Island", "Jarvis Island", "Kingman Reef", "Palmyra Atoll" ], - "UK": ["England", "Northern Ireland", "Scotland", "Wales, United Kingdom"], "Upper Volta": ["Burkina Faso"], - "Wake Island": ["Wake Atoll"], "Wales": ["Wales, United Kingdom"], "West Germany": ["Schleswig Holstein", "Northrhine Westphalia", "Bavaria, Germany"], "Yugoslavia": [ diff --git a/tools/geo/py/geo.py b/tools/geo/py/geo.py index fe736aab..e0dfb3cc 100644 --- a/tools/geo/py/geo.py +++ b/tools/geo/py/geo.py @@ -53,17 +53,14 @@ def get_countries(): html = read_wikipedia_url('ISO 3166-3') matches = re.compile('.*?', re.DOTALL).findall(html) countries += map(lambda x: parse(x), matches) - print sorted(map(lambda x: x['name'], countries)) # ISO 3166-1 alpha-2 html = fix(read_wikipedia_url('ISO 3166-1 alpha-2')) matches = re.compile('([A-Z]{2})\n