1
0
Fork 0
forked from 0x2620/oxjs
This commit is contained in:
rlx 2011-03-05 08:53:34 +00:00
commit 0fc4338bfd
6 changed files with 3719 additions and 218 deletions

View file

@ -14,16 +14,16 @@ Ox.COUNTRIES = [
{code: 'DZ', continent: 'Africa', name: 'Algeria', region: 'Northern Africa', type: 'sovereign'}, {code: 'DZ', continent: 'Africa', name: 'Algeria', region: 'Northern Africa', type: 'sovereign'},
{code: 'AD', continent: 'Europe', name: 'Andorra', region: 'Southern Europe', type: 'sovereign'}, {code: 'AD', continent: 'Europe', name: 'Andorra', region: 'Southern Europe', type: 'sovereign'},
{code: 'AO', continent: 'Africa', name: 'Angola', region: 'Middle Africa', type: 'sovereign'}, {code: 'AO', continent: 'Africa', name: 'Angola', region: 'Middle Africa', type: 'sovereign'},
{code: 'AG', continent: 'North America', name: 'Antigua and Barbuda', region: 'Carribean', type: 'sovereign'}, {code: 'AG', continent: 'North America', name: 'Antigua and Barbuda', region: 'Caribbean', type: 'sovereign'},
{code: 'AR', continent: 'South America', name: 'Argentina', type: 'sovereign'}, {code: 'AR', continent: 'South America', name: 'Argentina', type: 'sovereign'},
{code: 'AM', continent: 'Asia', name: 'Armenia', region: 'Western Asia', type: 'sovereign'}, {code: 'AM', continent: 'Asia', name: 'Armenia', region: 'Western Asia', type: 'sovereign'},
{code: 'AU', continent: 'Oceania', name: 'Australia', region: 'Australia and New Zealand', type: 'sovereign'}, {code: 'AU', continent: 'Oceania', name: 'Australia', region: 'Australia and New Zealand', type: 'sovereign'},
{code: 'AT', continent: 'Europe', name: 'Austria', region: 'Western Europe', type: 'sovereign'}, {code: 'AT', continent: 'Europe', name: 'Austria', region: 'Western Europe', type: 'sovereign'},
{code: 'AZ', continent: 'Asia', name: 'Azerbaijan', region: 'Western Asia', type: 'sovereign'}, {code: 'AZ', continent: 'Asia', name: 'Azerbaijan', region: 'Western Asia', type: 'sovereign'},
{code: 'BS', continent: 'North America', name: 'Bahamas', region: 'Carribean', type: 'sovereign'}, {code: 'BS', continent: 'North America', name: 'Bahamas', region: 'Caribbean', type: 'sovereign'},
{code: 'BH', continent: 'Asia', name: 'Bahrain', region: 'Western Asia', type: 'sovereign'}, {code: 'BH', continent: 'Asia', name: 'Bahrain', region: 'Western Asia', type: 'sovereign'},
{code: 'BD', continent: 'Asia', name: 'Bangladesh', region: 'Southern Asia', type: 'sovereign'}, {code: 'BD', continent: 'Asia', name: 'Bangladesh', region: 'Southern Asia', type: 'sovereign'},
{code: 'BB', continent: 'North America', name: 'Barbados', region: 'Carribean', type: 'sovereign'}, {code: 'BB', continent: 'North America', name: 'Barbados', region: 'Caribbean', type: 'sovereign'},
{code: 'BY', continent: 'Europe', name: 'Belarus', region: 'Eastern Europe', type: 'sovereign'}, {code: 'BY', continent: 'Europe', name: 'Belarus', region: 'Eastern Europe', type: 'sovereign'},
{code: 'BE', continent: 'Europe', name: 'Belgium', region: 'Western Europe', type: 'sovereign'}, {code: 'BE', continent: 'Europe', name: 'Belgium', region: 'Western Europe', type: 'sovereign'},
{code: 'BZ', continent: 'North America', name: 'Belize', region: 'Central America', type: 'sovereign'}, {code: 'BZ', continent: 'North America', name: 'Belize', region: 'Central America', type: 'sovereign'},
@ -50,14 +50,14 @@ Ox.COUNTRIES = [
{code: 'CR', continent: 'North America', name: 'Costa Rica', region: 'Central America', type: 'sovereign'}, {code: 'CR', continent: 'North America', name: 'Costa Rica', region: 'Central America', type: 'sovereign'},
{code: 'CI', continent: 'Africa', name: 'Côte d\'Ivoire', region: 'Western Africa', type: 'sovereign'}, {code: 'CI', continent: 'Africa', name: 'Côte d\'Ivoire', region: 'Western Africa', type: 'sovereign'},
{code: 'HR', continent: 'Europe', name: 'Croatia', region: 'Southern Europe', type: 'sovereign'}, {code: 'HR', continent: 'Europe', name: 'Croatia', region: 'Southern Europe', type: 'sovereign'},
{code: 'CU', continent: 'North America', name: 'Cuba', region: 'Carribean', type: 'sovereign'}, {code: 'CU', continent: 'North America', name: 'Cuba', region: 'Caribbean', type: 'sovereign'},
{code: 'CY', continent: 'Asia', name: 'Cyprus', region: 'Western Asia', type: 'sovereign'}, {code: 'CY', continent: 'Asia', name: 'Cyprus', region: 'Western Asia', type: 'sovereign'},
{code: 'CZ', continent: 'Europe', name: 'Czech Republic', region: 'Eastern Europe', type: 'sovereign'}, {code: 'CZ', continent: 'Europe', name: 'Czech Republic', region: 'Eastern Europe', type: 'sovereign'},
{code: 'CD', continent: 'Africa', name: 'Democratic Republic of the Congo', region: 'Middle Africa', type: 'sovereign'}, {code: 'CD', continent: 'Africa', name: 'Democratic Republic of the Congo', region: 'Middle Africa', type: 'sovereign'},
{code: 'DK', continent: 'Europe', name: 'Denmark', region: 'Northern Europe', type: 'sovereign'}, {code: 'DK', continent: 'Europe', name: 'Denmark', region: 'Northern Europe', type: 'sovereign'},
{code: 'DJ', continent: 'Africa', name: 'Djibouti', region: 'Eastern Africa', type: 'sovereign'}, {code: 'DJ', continent: 'Africa', name: 'Djibouti', region: 'Eastern Africa', type: 'sovereign'},
{code: 'DM', continent: 'North America', name: 'Dominica', region: 'Carribean', type: 'sovereign'}, {code: 'DM', continent: 'North America', name: 'Dominica', region: 'Caribbean', type: 'sovereign'},
{code: 'DO', continent: 'North America', name: 'Dominican Republic', region: 'Carribean', type: 'sovereign'}, {code: 'DO', continent: 'North America', name: 'Dominican Republic', region: 'Caribbean', type: 'sovereign'},
{code: 'EC', continent: 'South America', name: 'Ecuador', type: 'sovereign'}, {code: 'EC', continent: 'South America', name: 'Ecuador', type: 'sovereign'},
{code: 'EG', continent: 'Africa', name: 'Egypt', region: 'Northern Africa', type: 'sovereign'}, {code: 'EG', continent: 'Africa', name: 'Egypt', region: 'Northern Africa', type: 'sovereign'},
{code: 'SV', continent: 'North America', name: 'El Salvador', region: 'Central America', type: 'sovereign'}, {code: 'SV', continent: 'North America', name: 'El Salvador', region: 'Central America', type: 'sovereign'},
@ -74,12 +74,12 @@ Ox.COUNTRIES = [
{code: 'DE', continent: 'Europe', name: 'Germany', region: 'Western Europe', type: 'sovereign'}, {code: 'DE', continent: 'Europe', name: 'Germany', region: 'Western Europe', type: 'sovereign'},
{code: 'GH', continent: 'Africa', name: 'Ghana', region: 'Western Africa', type: 'sovereign'}, {code: 'GH', continent: 'Africa', name: 'Ghana', region: 'Western Africa', type: 'sovereign'},
{code: 'GR', continent: 'Europe', name: 'Greece', region: 'Southern Europe', type: 'sovereign'}, {code: 'GR', continent: 'Europe', name: 'Greece', region: 'Southern Europe', type: 'sovereign'},
{code: 'GD', continent: 'North America', name: 'Grenada', region: 'Carribean', type: 'sovereign'}, {code: 'GD', continent: 'North America', name: 'Grenada', region: 'Caribbean', type: 'sovereign'},
{code: 'GT', continent: 'North America', name: 'Guatemala', region: 'Central America', type: 'sovereign'}, {code: 'GT', continent: 'North America', name: 'Guatemala', region: 'Central America', type: 'sovereign'},
{code: 'GN', continent: 'Africa', name: 'Guinea', region: 'Western Africa', type: 'sovereign'}, {code: 'GN', continent: 'Africa', name: 'Guinea', region: 'Western Africa', type: 'sovereign'},
{code: 'GW', continent: 'Africa', name: 'Guinea-Bissau', region: 'Western Africa', type: 'sovereign'}, {code: 'GW', continent: 'Africa', name: 'Guinea-Bissau', region: 'Western Africa', type: 'sovereign'},
{code: 'GY', continent: 'South America', name: 'Guyana', type: 'sovereign'}, {code: 'GY', continent: 'South America', name: 'Guyana', type: 'sovereign'},
{code: 'HT', continent: 'North America', name: 'Haiti', region: 'Carribean', type: 'sovereign'}, {code: 'HT', continent: 'North America', name: 'Haiti', region: 'Caribbean', type: 'sovereign'},
{code: 'VA', continent: 'Europe', name: 'Holy See', region: 'Southern Europe', type: 'sovereign'}, {code: 'VA', continent: 'Europe', name: 'Holy See', region: 'Southern Europe', type: 'sovereign'},
{code: 'HN', continent: 'North America', name: 'Honduras', region: 'Central America', type: 'sovereign'}, {code: 'HN', continent: 'North America', name: 'Honduras', region: 'Central America', type: 'sovereign'},
{code: 'HU', continent: 'Europe', name: 'Hungary', region: 'Eastern Europe', type: 'sovereign'}, {code: 'HU', continent: 'Europe', name: 'Hungary', region: 'Eastern Europe', type: 'sovereign'},
@ -91,7 +91,7 @@ Ox.COUNTRIES = [
{code: 'IE', continent: 'Europe', name: 'Ireland', region: 'Northern Europe', type: 'sovereign'}, {code: 'IE', continent: 'Europe', name: 'Ireland', region: 'Northern Europe', type: 'sovereign'},
{code: 'IL', continent: 'Asia', name: 'Israel', region: 'Western Asia', type: 'sovereign'}, {code: 'IL', continent: 'Asia', name: 'Israel', region: 'Western Asia', type: 'sovereign'},
{code: 'IT', continent: 'Europe', name: 'Italy', region: 'Southern Europe', type: 'sovereign'}, {code: 'IT', continent: 'Europe', name: 'Italy', region: 'Southern Europe', type: 'sovereign'},
{code: 'JM', continent: 'North America', name: 'Jamaica', region: 'Carribean', type: 'sovereign'}, {code: 'JM', continent: 'North America', name: 'Jamaica', region: 'Caribbean', type: 'sovereign'},
{code: 'JP', continent: 'Asia', name: 'Japan', region: 'Eastern Asia', type: 'sovereign'}, {code: 'JP', continent: 'Asia', name: 'Japan', region: 'Eastern Asia', type: 'sovereign'},
{code: 'JO', continent: 'Asia', name: 'Jordan', region: 'Western Asia', type: 'sovereign'}, {code: 'JO', continent: 'Asia', name: 'Jordan', region: 'Western Asia', type: 'sovereign'},
{code: 'KZ', continent: 'Asia', name: 'Kazakhstan', region: 'Central Asia', type: 'sovereign'}, {code: 'KZ', continent: 'Asia', name: 'Kazakhstan', region: 'Central Asia', type: 'sovereign'},
@ -152,9 +152,9 @@ Ox.COUNTRIES = [
{code: 'RO', continent: 'Europe', name: 'Romania', region: 'Eastern Europe', type: 'sovereign'}, {code: 'RO', continent: 'Europe', name: 'Romania', region: 'Eastern Europe', type: 'sovereign'},
{code: 'RU', continent: 'Europe', name: 'Russia', region: 'Eastern Europe', type: 'sovereign'}, {code: 'RU', continent: 'Europe', name: 'Russia', region: 'Eastern Europe', type: 'sovereign'},
{code: 'RW', continent: 'Africa', name: 'Rwanda', region: 'Eastern Africa', type: 'sovereign'}, {code: 'RW', continent: 'Africa', name: 'Rwanda', region: 'Eastern Africa', type: 'sovereign'},
{code: 'KN', continent: 'North America', name: 'Saint Kitts and Nevis', region: 'Carribean', type: 'sovereign'}, {code: 'KN', continent: 'North America', name: 'Saint Kitts and Nevis', region: 'Caribbean', type: 'sovereign'},
{code: 'LC', continent: 'North America', name: 'Saint Lucia', region: 'Carribean', type: 'sovereign'}, {code: 'LC', continent: 'North America', name: 'Saint Lucia', region: 'Caribbean', type: 'sovereign'},
{code: 'VC', continent: 'North America', name: 'Saint Vincent and the Grenadines', region: 'Carribean', type: 'sovereign'}, {code: 'VC', continent: 'North America', name: 'Saint Vincent and the Grenadines', region: 'Caribbean', type: 'sovereign'},
{code: 'WS', continent: 'Oceania', name: 'Samoa', region: 'Polynesia', type: 'sovereign'}, {code: 'WS', continent: 'Oceania', name: 'Samoa', region: 'Polynesia', type: 'sovereign'},
{code: 'SM', continent: 'Europe', name: 'San Marino', region: 'Southern Europe', type: 'sovereign'}, {code: 'SM', continent: 'Europe', name: 'San Marino', region: 'Southern Europe', type: 'sovereign'},
{code: 'ST', continent: 'Africa', name: 'São Tomé and Príncipe', region: 'Middle Africa', type: 'sovereign'}, {code: 'ST', continent: 'Africa', name: 'São Tomé and Príncipe', region: 'Middle Africa', type: 'sovereign'},
@ -184,7 +184,7 @@ Ox.COUNTRIES = [
{code: 'TL', continent: 'Asia', name: 'Timor-Leste', region: 'South-Eastern Asia', type: 'sovereign'}, {code: 'TL', continent: 'Asia', name: 'Timor-Leste', region: 'South-Eastern Asia', type: 'sovereign'},
{code: 'TG', continent: 'Africa', name: 'Togo', region: 'Western Africa', type: 'sovereign'}, {code: 'TG', continent: 'Africa', name: 'Togo', region: 'Western Africa', type: 'sovereign'},
{code: 'TO', continent: 'Oceania', name: 'Tonga', region: 'Polynesia', type: 'sovereign'}, {code: 'TO', continent: 'Oceania', name: 'Tonga', region: 'Polynesia', type: 'sovereign'},
{code: 'TT', continent: 'North America', name: 'Trinidad and Tobago', region: 'Carribean', type: 'sovereign'}, {code: 'TT', continent: 'North America', name: 'Trinidad and Tobago', region: 'Caribbean', type: 'sovereign'},
{code: 'TN', continent: 'Africa', name: 'Tunisia', region: 'Northern Africa', type: 'sovereign'}, {code: 'TN', continent: 'Africa', name: 'Tunisia', region: 'Northern Africa', type: 'sovereign'},
{code: 'TR', continent: 'Asia', name: 'Turkey', region: 'Western Asia', type: 'sovereign'}, {code: 'TR', continent: 'Asia', name: 'Turkey', region: 'Western Asia', type: 'sovereign'},
{code: 'TM', continent: 'Asia', name: 'Turkmenistan', region: 'Central Asia', type: 'sovereign'}, {code: 'TM', continent: 'Asia', name: 'Turkmenistan', region: 'Central Asia', type: 'sovereign'},
@ -229,19 +229,19 @@ Ox.COUNTRIES = [
{code: 'GF', continent: 'South America', country: 'France', name: 'French Guiana', type: 'dependent'}, {code: 'GF', continent: 'South America', country: 'France', name: 'French Guiana', type: 'dependent'},
{code: 'PF', continent: 'Oceania', country: 'France', name: 'French Polynesia', region: 'Polynesia', type: 'dependent'}, {code: 'PF', continent: 'Oceania', country: 'France', name: 'French Polynesia', region: 'Polynesia', type: 'dependent'},
{code: 'TF', country: 'France', name: 'French Southern Territories', type: 'dependent'}, {code: 'TF', country: 'France', name: 'French Southern Territories', type: 'dependent'},
{code: 'GP', continent: 'North America', country: 'France', name: 'Guadeloupe', region: 'Carribean', type: 'dependent'}, {code: 'GP', continent: 'North America', country: 'France', name: 'Guadeloupe', region: 'Caribbean', type: 'dependent'},
{code: 'MQ', continent: 'North America', country: 'France', name: 'Martinique', region: 'Carribean', type: 'dependent'}, {code: 'MQ', continent: 'North America', country: 'France', name: 'Martinique', region: 'Caribbean', type: 'dependent'},
{code: 'YT', continent: 'Africa', country: 'France', name: 'Mayotte', region: 'Eastern Africa', type: 'dependent'}, {code: 'YT', continent: 'Africa', country: 'France', name: 'Mayotte', region: 'Eastern Africa', type: 'dependent'},
{code: 'NC', continent: 'Oceania', country: 'France', name: 'New Caledonia', region: 'Melanesia', type: 'dependent'}, {code: 'NC', continent: 'Oceania', country: 'France', name: 'New Caledonia', region: 'Melanesia', type: 'dependent'},
{code: 'RE', continent: 'Africa', country: 'France', name: 'Réunion', region: 'Eastern Africa', type: 'dependent', flag: 'png'}, {code: 'RE', continent: 'Africa', country: 'France', name: 'Réunion', region: 'Eastern Africa', type: 'dependent', flag: 'png'},
{code: 'BL', continent: 'North America', country: 'France', name: 'Saint Barthélemy', region: 'Carribean', type: 'dependent'}, {code: 'BL', continent: 'North America', country: 'France', name: 'Saint Barthélemy', region: 'Caribbean', type: 'dependent'},
{code: 'MF', continent: 'North America', country: 'France', name: 'Saint Martin', region: 'Carribean', type: 'dependent'}, {code: 'MF', continent: 'North America', country: 'France', name: 'Saint Martin', region: 'Caribbean', type: 'dependent'},
{code: 'PM', continent: 'North America', country: 'France', name: 'Saint Pierre and Miquelon', region: 'Northern America', type: 'dependent'}, {code: 'PM', continent: 'North America', country: 'France', name: 'Saint Pierre and Miquelon', region: 'Northern America', type: 'dependent'},
{code: 'WF', continent: 'Oceania', country: 'France', name: 'Wallis and Futuna', region: 'Polynesia', type: 'dependent'}, {code: 'WF', continent: 'Oceania', country: 'France', name: 'Wallis and Futuna', region: 'Polynesia', type: 'dependent'},
{code: 'AW', continent: 'North America', country: 'Netherlands', name: 'Aruba', region: 'Carribean', type: 'dependent'}, {code: 'AW', continent: 'North America', country: 'Netherlands', name: 'Aruba', region: 'Caribbean', type: 'dependent'},
{code: 'BQ', continent: 'North America', country: 'Netherlands', name: 'Bonaire, Saint Eustatius and Saba', region: 'Carribean', type: 'dependent'}, {code: 'BQ', continent: 'North America', country: 'Netherlands', name: 'Bonaire, Saint Eustatius and Saba', region: 'Caribbean', type: 'dependent'},
{code: 'CW', continent: 'North America', country: 'Netherlands', name: 'Curaçao', region: 'Carribean', type: 'dependent'}, {code: 'CW', continent: 'North America', country: 'Netherlands', name: 'Curaçao', region: 'Caribbean', type: 'dependent'},
{code: 'SX', continent: 'North America', country: 'Netherlands', name: 'Sint Maarten', region: 'Carribean', type: 'dependent'}, {code: 'SX', continent: 'North America', country: 'Netherlands', name: 'Sint Maarten', region: 'Caribbean', type: 'dependent'},
{code: 'CK', continent: 'Oceania', country: 'New Zealand', name: 'Cook Islands', region: 'Polynesia', type: 'dependent'}, {code: 'CK', continent: 'Oceania', country: 'New Zealand', name: 'Cook Islands', region: 'Polynesia', type: 'dependent'},
{code: 'NU', continent: 'Oceania', country: 'New Zealand', name: 'Niue', region: 'Polynesia', type: 'dependent'}, {code: 'NU', continent: 'Oceania', country: 'New Zealand', name: 'Niue', region: 'Polynesia', type: 'dependent'},
{code: 'TK', continent: 'Oceania', country: 'New Zealand', name: 'Tokelau', region: 'Polynesia', type: 'dependent'}, {code: 'TK', continent: 'Oceania', country: 'New Zealand', name: 'Tokelau', region: 'Polynesia', type: 'dependent'},
@ -249,12 +249,12 @@ Ox.COUNTRIES = [
{code: 'SJ', continent: 'Europe', country: 'Norway', name: 'Svalbard and Jan Mayen', region: 'Northern Europe', type: 'dependent'}, {code: 'SJ', continent: 'Europe', country: 'Norway', name: 'Svalbard and Jan Mayen', region: 'Northern Europe', type: 'dependent'},
{code: 'IC', continent: 'Africa', country: 'Spain', name: 'Canary Islands', region: 'Northern Africa', type: 'dependent'}, {code: 'IC', continent: 'Africa', country: 'Spain', name: 'Canary Islands', region: 'Northern Africa', type: 'dependent'},
{code: 'EA', continent: 'Africa', country: 'Spain', name: 'Ceuta and Melilla', region: 'Northern Africa', type: 'dependent'}, {code: 'EA', continent: 'Africa', country: 'Spain', name: 'Ceuta and Melilla', region: 'Northern Africa', type: 'dependent'},
{code: 'AI', continent: 'North America', country: 'United Kingdom', name: 'Anguilla', region: 'Carribean', type: 'dependent'}, {code: 'AI', continent: 'North America', country: 'United Kingdom', name: 'Anguilla', region: 'Caribbean', type: 'dependent'},
{code: 'AC', continent: 'Africa', country: 'United Kingdom', name: 'Ascension', region: 'Western Africa', type: 'dependent'}, {code: 'AC', continent: 'Africa', country: 'United Kingdom', name: 'Ascension', region: 'Western Africa', type: 'dependent'},
{code: 'BM', continent: 'North America', country: 'United Kingdom', name: 'Bermuda', region: 'Northern America', type: 'dependent'}, {code: 'BM', continent: 'North America', country: 'United Kingdom', name: 'Bermuda', region: 'Northern America', type: 'dependent'},
{code: 'IO', country: 'United Kingdom', name: 'British Indian Ocean Territory', type: 'dependent'}, {code: 'IO', country: 'United Kingdom', name: 'British Indian Ocean Territory', type: 'dependent'},
{code: 'VG', continent: 'North America', country: 'United Kingdom', name: 'British Virgin Islands', region: 'Carribean', type: 'dependent'}, {code: 'VG', continent: 'North America', country: 'United Kingdom', name: 'British Virgin Islands', region: 'Caribbean', type: 'dependent'},
{code: 'KY', continent: 'North America', country: 'United Kingdom', name: 'Cayman Islands', region: 'Carribean', type: 'dependent'}, {code: 'KY', continent: 'North America', country: 'United Kingdom', name: 'Cayman Islands', region: 'Caribbean', type: 'dependent'},
{code: 'DG', country: 'United Kingdom', name: 'Diego Garcia', type: 'dependent'}, {code: 'DG', country: 'United Kingdom', name: 'Diego Garcia', type: 'dependent'},
{code: 'GB-ENG', continent: 'Europe', country: 'United Kingdom', name: 'England', region: 'Northern Europe', type: 'dependent'}, {code: 'GB-ENG', continent: 'Europe', country: 'United Kingdom', name: 'England', region: 'Northern Europe', type: 'dependent'},
{code: 'FK', continent: 'South America', country: 'United Kingdom', name: 'Falkland Islands', type: 'dependent'}, {code: 'FK', continent: 'South America', country: 'United Kingdom', name: 'Falkland Islands', type: 'dependent'},
@ -262,21 +262,21 @@ Ox.COUNTRIES = [
{code: 'GG', continent: 'Europe', country: 'United Kingdom', name: 'Guernsey', region: 'Northern Europe', type: 'dependent'}, {code: 'GG', continent: 'Europe', country: 'United Kingdom', name: 'Guernsey', region: 'Northern Europe', type: 'dependent'},
{code: 'IM', continent: 'Europe', country: 'United Kingdom', name: 'Isle of Man', region: 'Northern Europe', type: 'dependent'}, {code: 'IM', continent: 'Europe', country: 'United Kingdom', name: 'Isle of Man', region: 'Northern Europe', type: 'dependent'},
{code: 'JE', continent: 'Europe', country: 'United Kingdom', name: 'Jersey', region: 'Northern Europe', type: 'dependent'}, {code: 'JE', continent: 'Europe', country: 'United Kingdom', name: 'Jersey', region: 'Northern Europe', type: 'dependent'},
{code: 'MS', continent: 'North America', country: 'United Kingdom', name: 'Montserrat', region: 'Carribean', type: 'dependent'}, {code: 'MS', continent: 'North America', country: 'United Kingdom', name: 'Montserrat', region: 'Caribbean', type: 'dependent'},
{code: 'GB-NIR', continent: 'Europe', country: 'United Kingdom', name: 'Northern Ireland', region: 'Northern Europe', type: 'dependent'}, {code: 'GB-NIR', continent: 'Europe', country: 'United Kingdom', name: 'Northern Ireland', region: 'Northern Europe', type: 'dependent'},
{code: 'PN', continent: 'Oceania', country: 'United Kingdom', name: 'Pitcairn', region: 'Polynesia', type: 'dependent'}, {code: 'PN', continent: 'Oceania', country: 'United Kingdom', name: 'Pitcairn', region: 'Polynesia', type: 'dependent'},
{code: 'SH', continent: 'Africa', country: 'United Kingdom', name: 'Saint Helena', region: 'Western Africa', type: 'dependent'}, {code: 'SH', continent: 'Africa', country: 'United Kingdom', name: 'Saint Helena', region: 'Western Africa', type: 'dependent'},
{code: 'GB-SCT', continent: 'Europe', country: 'United Kingdom', name: 'Scotland', region: 'Northern Europe', type: 'dependent'}, {code: 'GB-SCT', continent: 'Europe', country: 'United Kingdom', name: 'Scotland', region: 'Northern Europe', type: 'dependent'},
{code: 'GS', continent: 'South America', country: 'United Kingdom', name: 'South Georgia and the South Sandwich Islands', type: 'dependent'}, {code: 'GS', continent: 'South America', country: 'United Kingdom', name: 'South Georgia and the South Sandwich Islands', type: 'dependent'},
{code: 'TA', continent: 'Africa', country: 'United Kingdom', name: 'Tristan da Cunha', region: 'Western Africa', type: 'dependent'}, {code: 'TA', continent: 'Africa', country: 'United Kingdom', name: 'Tristan da Cunha', region: 'Western Africa', type: 'dependent'},
{code: 'TC', continent: 'Oceania', country: 'United Kingdom', name: 'Turks and Caicos Islands', region: 'Carribean', type: 'dependent'}, {code: 'TC', continent: 'Oceania', country: 'United Kingdom', name: 'Turks and Caicos Islands', region: 'Caribbean', type: 'dependent'},
{code: 'GB-WLS', continent: 'Europe', country: 'United Kingdom', name: 'Wales', region: 'Northern Europe', type: 'dependent'}, {code: 'GB-WLS', continent: 'Europe', country: 'United Kingdom', name: 'Wales', region: 'Northern Europe', type: 'dependent'},
{code: 'AS', continent: 'Oceania', country: 'United States', name: 'American Samoa', region: 'Polynesia', type: 'dependent'}, {code: 'AS', continent: 'Oceania', country: 'United States', name: 'American Samoa', region: 'Polynesia', type: 'dependent'},
{code: 'GU', continent: 'Oceania', country: 'United States', name: 'Guam', region: 'Micronesia', type: 'dependent'}, {code: 'GU', continent: 'Oceania', country: 'United States', name: 'Guam', region: 'Micronesia', type: 'dependent'},
{code: 'MP', continent: 'Oceania', country: 'United States', name: 'Northern Mariana Islands', region: 'Micronesia', type: 'dependent'}, {code: 'MP', continent: 'Oceania', country: 'United States', name: 'Northern Mariana Islands', region: 'Micronesia', type: 'dependent'},
{code: 'PR', continent: 'North America', country: 'United States', name: 'Puerto Rico', region: 'Carribean', type: 'dependent'}, {code: 'PR', continent: 'North America', country: 'United States', name: 'Puerto Rico', region: 'Caribbean', type: 'dependent'},
{code: 'UM', country: 'United States', name: 'United States Minor Outlying Islands', type: 'dependent'}, {code: 'UM', country: 'United States', name: 'United States Minor Outlying Islands', type: 'dependent'},
{code: 'VI', continent: 'North America', country: 'United States', name: 'United States Virgin Islands', region: 'Carribean', type: 'dependent'}, {code: 'VI', continent: 'North America', country: 'United States', name: 'United States Virgin Islands', region: 'Caribbean', type: 'dependent'},
{code: 'BUMM', continent: 'Asia', name: 'Burma', region: 'South-Eastern Asia', type: 'former'}, {code: 'BUMM', continent: 'Asia', name: 'Burma', region: 'South-Eastern Asia', type: 'former'},
{code: 'BYAA', continent: 'Europe', name: 'Byelorussian Soviet Socialist Republic', region: 'Eastern Europe', type: 'former'}, {code: 'BYAA', continent: 'Europe', name: 'Byelorussian Soviet Socialist Republic', region: 'Eastern Europe', type: 'former'},
{code: 'CTKI', continent: 'Oceania', name: 'Canton and Enderbury Islands', region: 'Micronesia', type: 'former'}, {code: 'CTKI', continent: 'Oceania', name: 'Canton and Enderbury Islands', region: 'Micronesia', type: 'former'},
@ -302,7 +302,7 @@ Ox.COUNTRIES = [
{code: 'FQHH', continent: 'Antarctica', country: 'France', name: 'French Southern and Antarctic Territories', type: 'former'}, {code: 'FQHH', continent: 'Antarctica', country: 'France', name: 'French Southern and Antarctic Territories', type: 'former'},
{code: 'FXFR', continent: 'Europe', country: 'France', name: 'Metropolitan France', type: 'former'}, {code: 'FXFR', continent: 'Europe', country: 'France', name: 'Metropolitan France', type: 'former'},
{code: 'NHVU', country: ['France', 'United Kingdom'], name: 'New Hebrides', region: 'Melanesia', type: 'former'}, {code: 'NHVU', country: ['France', 'United Kingdom'], name: 'New Hebrides', region: 'Melanesia', type: 'former'},
{code: 'ANHH', continent: 'North America', country: 'Netherlands', name: 'Netherlands Antilles', region: 'Carribean', type: 'former'}, {code: 'ANHH', continent: 'North America', country: 'Netherlands', name: 'Netherlands Antilles', region: 'Caribbean', type: 'former'},
{code: 'NQAQ', continent: 'Antarctica', country: 'Norway', name: 'Dronning Maud Land', type: 'former'}, {code: 'NQAQ', continent: 'Antarctica', country: 'Norway', name: 'Dronning Maud Land', type: 'former'},
{code: 'BQAQ', continent: 'Antarctica', country: 'United Kingdom', name: 'British Antarctic Territory', type: 'former'}, {code: 'BQAQ', continent: 'Antarctica', country: 'United Kingdom', name: 'British Antarctic Territory', type: 'former'},
{code: 'JTUM', continent: 'Oceania', country: 'United States', name: 'Johnston Island', region: 'Mictonesia', type: 'former'}, {code: 'JTUM', continent: 'Oceania', country: 'United States', name: 'Johnston Island', region: 'Mictonesia', type: 'former'},

View file

@ -9208,13 +9208,9 @@ requires
Ox.print('PLACES', places) Ox.print('PLACES', places)
self.$map = new Ox.Map({ self.$map = new Ox.Map({
clickable: true, clickable: true,
editable: true,
height: self.options.height, height: self.options.height,
// fixme: place can still be string, and maybe shouldn't be array at all places: places,
places: places.map(function(place) {
return Ox.extend({}, place, {
name: place.name.length == 0 ? '' : place.name[0]
});
}),
statusbar: true, statusbar: true,
toolbar: true, toolbar: true,
width: self.mapResize[1], width: self.mapResize[1],
@ -9429,7 +9425,7 @@ requires
.appendTo(that); .appendTo(that);
self.$labelsButton = new Ox.Button({ self.$labelsButton = new Ox.Button({
title: 'Show Labels', title: 'Show Labels',
width: 80 width: 96
}) })
.css({float: 'left', margin: '4px'}) .css({float: 'left', margin: '4px'})
.bindEvent({ .bindEvent({
@ -9470,19 +9466,19 @@ requires
.appendTo(that); .appendTo(that);
self.$placeNameInput = new Ox.Input({ self.$placeNameInput = new Ox.Input({
placeholder: 'Name', placeholder: 'Name',
width: Math.floor((self.options.width - 96) / 2) width: Math.floor((self.options.width - 112) / 2)
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '2px'})
.appendTo(self.$statusbar); .appendTo(self.$statusbar);
self.$placeGeonameInput = new Ox.Input({ self.$placeGeonameInput = new Ox.Input({
placeholder: 'Geoname', placeholder: 'Geoname',
width: Math.ceil((self.options.width - 96) / 2) width: Math.ceil((self.options.width - 112) / 2)
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '2px'})
.appendTo(self.$statusbar) .appendTo(self.$statusbar)
self.$placeButton = new Ox.Button({ self.$placeButton = new Ox.Button({
title: 'New Place', title: 'New Place',
width: 80 width: 96
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '2px'})
.bindEvent({ .bindEvent({
@ -9550,37 +9546,54 @@ requires
initMap(); initMap();
} }
function addNewPlace() { function addPlaceToMap(place) {
var bounds = self.map.getBounds(), if (!place) {
center = self.map.getCenter(), var bounds = self.map.getBounds(),
southwest = new google.maps.LatLngBounds( center = self.map.getCenter(),
bounds.getSouthWest(), center southwest = new google.maps.LatLngBounds(
).getCenter(), bounds.getSouthWest(), center
northeast = new google.maps.LatLngBounds( ).getCenter(),
center, bounds.getNorthEast() northeast = new google.maps.LatLngBounds(
).getCenter(), center, bounds.getNorthEast()
place = new Place({ ).getCenter(),
countryCode: '', place = new Ox.MapPlace({
geoname: '', countryCode: '',
id: '_' + Ox.uid(), // fixme: stupid editable: true,
name: '', geoname: '',
south: southwest.lat(), id: '_' + Ox.uid(), // fixme: stupid
west: southwest.lng(), lat: center.lat(),
north: northeast.lat(), lng: center.lng(),
east: northeast.lng() map: that,
}); name: '',
addPlace(place); south: southwest.lat(),
selectPlace(place.name); west: southwest.lng(),
} north: northeast.lat(),
east: northeast.lng()
function addPlace(place) { });
Ox.print('addPlace', place) }
Ox.print('addPlaceToMap', place)
Ox.print('self.resultPlace', self.resultPlace) Ox.print('self.resultPlace', self.resultPlace)
self.resultPlace && self.resultPlace.remove(); self.resultPlace && self.resultPlace.remove();
if (place.id[0] == '_') { self.resultPlace = place;
self.resultPlace = place;
}
place.add(); place.add();
selectPlace(place.id);
}
function addPlaceToPlaces() {
var place = getSelectedPlace();
if (self.options.selected == place.id) {
self.options.selected = place.id.substr(1);
self.selected = self.options.selected;
}
place.id = place.id.substr(1); // fixme: NOT SAFE!
place.name = self.$placeNameInput.value();
place.geoname = self.$placeGeonameInput.value();
place.countryCode = Ox.getCountryCode(place.geoname);
place.marker.update();
self.places.push(place);
self.resultPlace = null;
that.triggerEvent('addplace', place)
Ox.print('SSSS', self.options.selected)
} }
function boundsChanged() { function boundsChanged() {
@ -9610,7 +9623,7 @@ requires
if (self.options.clickable/* && !editing()*/) { if (self.options.clickable/* && !editing()*/) {
getPlaceByLatLng(event.latLng, self.map.getBounds(), function(place) { getPlaceByLatLng(event.latLng, self.map.getBounds(), function(place) {
if (place) { if (place) {
addPlace(place); addPlaceToMap(place);
selectPlace(place.id); selectPlace(place.id);
} }
}); });
@ -9618,22 +9631,14 @@ requires
} }
function clickPlaceButton() { function clickPlaceButton() {
if (self.$placeButton.options('title') == 'New Place') { var place = getSelectedPlace(),
addNewPlace(); title = self.$placeButton.options('title');
} else { if (title == 'New Place') {
var place = getSelectedPlace(), addPlaceToMap();
data = { } else if (title == 'Add Place') {
place: {} addPlaceToPlaces();
}; } else if (title == 'Remove Place') {
data.place.name = self.$placeNameInput.value();
data.place.geoname = self.$placeGeonameInput.value();
data.place.countryCode = Ox.getCountryCode(data.place.geoname);
[
'lat', 'lng', 'south', 'west', 'north', 'east', 'size'
].forEach(function(key) {
data.place[key] = place[key];
});
that.triggerEvent('addplace', data)
} }
} }
@ -9658,7 +9663,21 @@ requires
} }
function editing() { function editing() {
return self.selected && getSelectedPlace().editing; var place = getSelectedPlace();
return place && place.editing;
}
function getElevation(point, callback) {
// fixme: unused
if (arguments.length == 1) {
callback = point;
point = self.map.getCenter();
}
self.elevationService.getElevationForLocations({
locations: [point]
}, function(data) {
callback(data.elevation);
});
} }
function getMapHeight() { function getMapHeight() {
@ -9678,7 +9697,7 @@ requires
point = self.map.getCenter(); point = self.map.getCenter();
} }
self.maxZoomService.getMaxZoomAtLatLng(point, function(data) { self.maxZoomService.getMaxZoomAtLatLng(point, function(data) {
callback(data.status == 'OK' ? data.zoom : -1); callback(data.status == 'OK' ? data.zoom : null);
}); });
} }
@ -9761,11 +9780,13 @@ requires
} }
function getSelectedPlace() { function getSelectedPlace() {
return self.selected ? getPlaceById(self.selected) : null; return self.options.selected ?
getPlaceById(self.options.selected) : null;
} }
function initMap() { function initMap() {
var mapBounds; var mapBounds;
self.elevationService = new google.maps.ElevationService();
self.geocoder = new google.maps.Geocoder(); self.geocoder = new google.maps.Geocoder();
self.maxZoomService = new google.maps.MaxZoomService(); self.maxZoomService = new google.maps.MaxZoomService();
self.places = []; self.places = [];
@ -9841,6 +9862,7 @@ requires
components: data.address_components, components: data.address_components,
countryCode: getCountryCode(data.address_components), countryCode: getCountryCode(data.address_components),
east: bounds.getNorthEast().lng(), east: bounds.getNorthEast().lng(),
editable: self.options.editable,
fullGeoname: getFullGeoname(data.address_components), fullGeoname: getFullGeoname(data.address_components),
geoname: data.formatted_address, geoname: data.formatted_address,
id: '_' + Ox.uid(), id: '_' + Ox.uid(),
@ -9937,10 +9959,14 @@ requires
Ox.print('Ox.Map selectPlace()', id, self.selected) Ox.print('Ox.Map selectPlace()', id, self.selected)
var place; var place;
if (id != self.selected) { if (id != self.selected) {
place = getSelectedPlace(); place = getPlaceById(self.selected);
place && place.deselect(); place && place.deselect();
place = getPlaceById(id); place = getPlaceById(id);
place && place.select(); place && place.select();
self.selected = id;
self.options.selected = id;
setStatus();
that.triggerEvent('selectplace', place);
} }
if (id) { if (id) {
//self.map.setCenter(place.center); //self.map.setCenter(place.center);
@ -9954,32 +9980,31 @@ requires
} }
*/ */
} }
self.options.selected = id; //Ox.print('????', place)
self.selected = id;
setStatus();
that.triggerEvent('selectplace', place);
/*
that.triggerEvent('select', {
id: self.options.selected
});
*/
}; };
function setStatus() { function setStatus() {
Ox.print('setStatus()', self.options.selected) Ox.print('setStatus()', self.options.selected)
var place; var disabled, place, title;
if (self.options.statusbar) { if (self.options.statusbar) {
if (self.options.selected) { if (self.options.selected) {
place = getPlaceById(self.options.selected); place = getSelectedPlace();
title = place.id[0] == '_' ? 'Add Place' : 'Remove Place';
} else {
title = 'New Place';
} }
disabled = place && !place.editable;
self.$placeNameInput.options({ self.$placeNameInput.options({
disabled: disabled,
value: self.options.selected ? place.name : '' value: self.options.selected ? place.name : ''
}); });
self.$placeGeonameInput.options({ self.$placeGeonameInput.options({
disabled: disabled,
value: self.options.selected ? place.geoname : '' value: self.options.selected ? place.geoname : ''
}); });
self.$placeButton.options({ self.$placeButton.options({
title: self.options.selected ? 'Add Place' : 'New Place' disabled: disabled,
title: title
}); });
} }
} }
@ -10094,12 +10119,13 @@ requires
that.editPlace = function() { that.editPlace = function() {
getPlaceById(self.options.selected).edit(); getPlaceById(self.options.selected).edit();
return that;
} }
that.findPlace = function(name, callback) { that.findPlace = function(name, callback) {
getPlaceByName(name, function(place) { getPlaceByName(name, function(place) {
if (place) { if (place) {
addPlace(place); addPlaceToMap(place);
self.resultPlace = place; self.resultPlace = place;
selectPlace(place.id); selectPlace(place.id);
self.bounds = place.bounds; self.bounds = place.bounds;
@ -10112,13 +10138,13 @@ requires
that.panToPlace = function() { that.panToPlace = function() {
Ox.print('panToPlace:', self.options.selected) Ox.print('panToPlace:', self.options.selected)
if (self.options.selected !== null) { var place = getSelectedPlace();
self.map.panTo(getPlaceById(self.options.selected).center); place && self.map.panTo(place.center);
} return that;
}; };
that.removePlace = function(id) { that.removePlace = function(id) {
return that;
}; };
that.resizeMap = function() { that.resizeMap = function() {
@ -10136,17 +10162,19 @@ requires
self.options.zoombar && self.$zoomInput.options({ self.options.zoombar && self.$zoomInput.options({
size: self.options.width size: self.options.width
}); });
return that;
} }
that.zoomToPlace = function() { that.zoomToPlace = function() {
Ox.print('zoomToPlace') Ox.print('zoomToPlace')
if (self.options.selected !== null) { var place = getSelectedPlace();
self.map.fitBounds(getPlaceById(self.options.selected).bounds); place && self.map.fitBounds(place.bounds);
} return that;
}; };
that.zoom = function(value) { that.zoom = function(value) {
self.map.setZoom(value); self.map.setZoom(value);
return that;
}; };
return that; return that;
@ -10193,6 +10221,7 @@ requires
nw: new google.maps.LatLng(that.north, that.west), nw: new google.maps.LatLng(that.north, that.west),
w: new google.maps.LatLng(that.lat, that.west), w: new google.maps.LatLng(that.lat, that.west),
}); });
// fixme: use bounds.toSpan()
that.sizeNorthSouth = (that.north - that.south) * that.sizeNorthSouth = (that.north - that.south) *
Ox.EARTH_CIRCUMFERENCE / 360; Ox.EARTH_CIRCUMFERENCE / 360;
that.sizeEastWest = (that.east + (that.west > that.east ? 360 : 0) - that.west) * that.sizeEastWest = (that.east + (that.west > that.east ? 360 : 0) - that.west) *
@ -10214,6 +10243,10 @@ requires
//Ox.print('PLACE', that) //Ox.print('PLACE', that)
} }
function editable() {
return that.map.options('editable') && that.editable;
}
that.add = function() { that.add = function() {
Ox.print('MapPlace add', that) Ox.print('MapPlace add', that)
that.marker.add(); that.marker.add();
@ -10221,10 +10254,12 @@ requires
}; };
that.cancel = function() { that.cancel = function() {
that.undo(); if (editable()) {
that.editing = false; that.undo();
that.marker.update(); that.editing = false;
that.rectangle.deselect(); that.marker.update();
that.rectangle.deselect();
}
return that; return that;
}; };
@ -10241,15 +10276,17 @@ requires
}; };
that.edit = function() { that.edit = function() {
that.editing = true; if (editable()) {
that.original = { that.editing = true;
east: that.east, that.original = {
north: that.north, east: that.east,
south: that.south, north: that.north,
west: that.west south: that.south,
}; west: that.west
that.marker.edit(); };
that.rectangle.select(); that.marker.edit();
that.rectangle.select();
}
return that; return that;
} }
@ -10269,24 +10306,30 @@ requires
}; };
that.submit = function() { that.submit = function() {
Ox.print('submit') if (editable()) {
that.editing = false; Ox.print('submit')
that.marker.update(); that.editing = false;
that.rectangle.deselect(); that.marker.update();
that.rectangle.deselect();
}
return that; return that;
}; };
that.update = function() { that.update = function() {
update(); update();
return that;
}; };
that.undo = function() { that.undo = function() {
Ox.forEach(that.original, function(v, k) { if (editable()) {
that[k] = v; Ox.forEach(that.original, function(v, k) {
}); that[k] = v;
that.update(); });
that.marker.update(); that.update();
that.rectangle.update(); that.marker.update();
that.rectangle.update();
}
return that;
}; };
return that; return that;
@ -10455,7 +10498,7 @@ requires
setOptions(); setOptions();
function click() { function click() {
if (!that.place.editing) { if (that.map.options('editable') && that.place.editable && !that.place.editing) {
that.place.edit(); that.place.edit();
} else if (that.map.getKey() == 'meta') { } else if (that.map.getKey() == 'meta') {
that.place.submit(); that.place.submit();
@ -10553,6 +10596,7 @@ requires
} }
function drag(e) { function drag(e) {
// fixme: implement shift+drag (center stays the same)
Ox.print(e.pixel.x, e.pixel.y) Ox.print(e.pixel.x, e.pixel.y)
var lat = Ox.limit(e.latLng.lat(), Ox.MIN_LATITUDE, Ox.MAX_LATITUDE), var lat = Ox.limit(e.latLng.lat(), Ox.MIN_LATITUDE, Ox.MAX_LATITUDE),
lng = e.latLng.lng(); lng = e.latLng.lng();

15
demos/listmap/index.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>ox.js listmap demo</title
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="../../build/css/ox.ui.css"/>
<script src="../../build/js/jquery-1.5.js"></script>
<script src="../../build/js/ox.js"></script>
<script src="../../build/js/ox.map.js"></script>
<script src="../../build/js/ox.ui.js"></script>
<script src="js/listmap.js"></script>
</head>
<body>
</body>
</html>

View file

@ -0,0 +1,48 @@
$(function() {
Ox.theme('modern');
var listmap = new Ox.ListMap({
height: window.innerHeight,
places: [
{
editable: true,
flag: 'UK',
geoname: 'Westminster, London, UK',
id: '0',
name: 'London',
//lat: 51.5001524,
lat: 51.52670875,
lng: -0.1262362,
south: 51.3493528,
west: -0.378358,
north: 51.7040647,
east: 0.1502295
},
{
editable: false,
flag: 'FR',
geoname: 'Paris, France',
id: '1',
name: 'Paris',
lat: 48.8566667,
lng: 2.3509871,
south: 48.8155414,
west: 2.2241006,
north: 48.9021461,
east: 2.4699099,
}
],
width: window.innerWidth
})
.appendTo($('body'));
$(window).resize(function() {
Ox.print('RESIZE', window.innerHeight)
listmap.options({
height: window.innerHeight,
width: window.innerWidth
});
});
window.listmap = listmap;
});

View file

@ -1,95 +1,110 @@
$(function() { $(function() {
var width = window.innerWidth - 256, $.getJSON('json/countries.json', function(data) {
height = window.innerHeight,
map = new Ox.Map({ var width = window.innerWidth - 256,
clickable: true, height = window.innerHeight,
height: height, map = new Ox.Map({
/* clickable: true,
places: Ox.COUNTRIES.map(function(country) { editable: true,
return country.name; height: height,
}), places: data.map(function(place) {
*/ return Ox.extend({
places: [ editable: true,
{ geoname: place.name,
flag: 'UK', name: place.name,
geoname: 'Westminster, London, UK', south: place.south,
name: 'London', west: place.west,
//lat: 51.5001524, north: place.north,
lat: 51.52670875, east: place.east
lng: -0.1262362, });
south: 51.3493528, }),
west: -0.378358, /*
north: 51.7040647, [
east: 0.1502295 {
}, editable: true,
{ flag: 'UK',
flag: 'FR', geoname: 'Westminster, London, UK',
geoname: 'Paris, France', name: 'London',
name: 'Paris', //lat: 51.5001524,
lat: 48.8566667, lat: 51.52670875,
lng: 2.3509871, lng: -0.1262362,
south: 48.8155414, south: 51.3493528,
west: 2.2241006, west: -0.378358,
north: 48.9021461, north: 51.7040647,
east: 2.4699099, east: 0.1502295
} },
], {
statusbar: true, editable: false,
toolbar: true, flag: 'FR',
width: width, geoname: 'Paris, France',
zoombar: true name: 'Paris',
}) lat: 48.8566667,
.bindEvent({ lng: 2.3509871,
selectplace: function(event, data) { south: 48.8155414,
Ox.print('DATA', data) west: 2.2241006,
panel.replaceElement(1, list = new Ox.TreeList({ north: 48.9021461,
data: Ox.isEmpty(data) ? [] : { east: 2.4699099,
components: data.components,
countryCode: data.countryCode,
crossesDateline: data.crossesDateline(),
east: data.east,
fullGeoname: data.fullGeoname,
geoname: data.geoname,
lat: data.lat,
lng: data.lng,
name: data.name,
north: data.north,
size: data.size,
sizeEastWest: data.sizeEastWest,
sizeNorthSouth: data.sizeNorthSouth,
south: data.south,
west: data.west,
types: data.types
} }
})); ],
} */
}), statusbar: true,
list = new Ox.TreeList({ toolbar: true,
data: [], width: width,
width: 256 zoombar: true
}) })
panel = new Ox.SplitPanel({ .bindEvent({
elements: [ selectplace: function(event, data) {
{ Ox.print('DATA', data)
element: map panel.replaceElement(1, list = new Ox.TreeList({
}, data: Ox.isEmpty(data) ? [] : {
{ components: data.components,
element: list, countryCode: data.countryCode,
size: 256 crossesDateline: data.crossesDateline(),
east: data.east,
fullGeoname: data.fullGeoname,
geoname: data.geoname,
lat: data.lat,
lng: data.lng,
name: data.name,
north: data.north,
size: data.size,
sizeEastWest: data.sizeEastWest,
sizeNorthSouth: data.sizeNorthSouth,
south: data.south,
west: data.west,
types: data.types
}
}));
} }
], }),
orientation: 'horizontal' list = new Ox.TreeList({
}) data: [],
.appendTo($('body')); width: 256
})
panel = new Ox.SplitPanel({
elements: [
{
element: map
},
{
element: list,
size: 256
}
],
orientation: 'horizontal'
})
.appendTo($('body'));
map.gainFocus(); map.gainFocus();
$(window).resize(function() { $(window).resize(function() {
map.options({ map.options({
height: window.innerHeight, height: window.innerHeight,
width: window.innerWidth - 256 width: window.innerWidth - 256
});
}); });
}); });
}); });

File diff suppressed because it is too large Load diff