This commit is contained in:
rlx 2011-03-05 10:48:01 +00:00
parent 0fc4338bfd
commit dc86a5c53e
2 changed files with 137 additions and 114 deletions

View file

@ -9462,25 +9462,24 @@ requires
self.$statusbar = new Ox.Bar({ self.$statusbar = new Ox.Bar({
size: 24 size: 24
}) })
.css({padding: '2px'})
.appendTo(that); .appendTo(that);
self.$placeNameInput = new Ox.Input({ self.$placeNameInput = new Ox.Input({
placeholder: 'Name', placeholder: 'Name',
width: Math.floor((self.options.width - 112) / 2) width: Math.floor((self.options.width - 112) / 2)
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '4px 2px 4px 4px'})
.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 - 112) / 2) width: Math.ceil((self.options.width - 112) / 2)
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '4px 2px 4px 2px'})
.appendTo(self.$statusbar) .appendTo(self.$statusbar)
self.$placeButton = new Ox.Button({ self.$placeButton = new Ox.Button({
title: 'New Place', title: 'New Place',
width: 96 width: 96
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '4px 4px 4px 2px'})
.bindEvent({ .bindEvent({
click: clickPlaceButton click: clickPlaceButton
}) })
@ -9839,6 +9838,29 @@ requires
function mapChanged() { function mapChanged() {
// gets called after panning or zooming // gets called after panning or zooming
Ox.print('mapChanged'); Ox.print('mapChanged');
var bounds, places
if (self.boundsChanged) {
/*
bounds = self.map.getBounds();
places = Ox.clone(self.places).filter(function(place) {
return bounds.contains(place.center);
});
if (places.length > 100) {
places.sort(function(a, b) {
return a.size < b.size ? 1 : (a.size > b.size ? -1 : 0);
});
}
self.places.forEach(function(place) {
place.remove();
});
places.forEach(function(place, i) {
if (i < 100) {
place.add();
}
});
*/
self.boundsChanged = false;
}
if (self.centerChanged) { if (self.centerChanged) {
getMaxZoom(function(zoom) { getMaxZoom(function(zoom) {
if (zoom != self.maxZoom) { if (zoom != self.maxZoom) {
@ -9846,10 +9868,11 @@ requires
constructZoomInput(); constructZoomInput();
} }
}); });
}
self.boundsChanged = false;
self.centerChanged = false; self.centerChanged = false;
}
if (self.zoomChanged) {
self.zoomChanged = false; self.zoomChanged = false;
}
} }
function pan(x, y) { function pan(x, y) {

View file

@ -70,7 +70,7 @@
"code": "AI", "code": "AI",
"name": "Anguilla", "name": "Anguilla",
"country": "United Kingdom", "country": "United Kingdom",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 18.1465043, "south": 18.1465043,
@ -99,7 +99,7 @@
{ {
"code": "AG", "code": "AG",
"name": "Antigua and Barbuda", "name": "Antigua and Barbuda",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 16.9018, "south": 16.9018,
@ -132,7 +132,7 @@
"code": "AW", "code": "AW",
"name": "Aruba", "name": "Aruba",
"country": "Netherlands", "country": "Netherlands",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 12.406093, "south": 12.406093,
@ -198,7 +198,7 @@
{ {
"code": "BS", "code": "BS",
"name": "Bahamas", "name": "Bahamas",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 20.8536786, "south": 20.8536786,
@ -231,7 +231,7 @@
{ {
"code": "BB", "code": "BB",
"name": "Barbados", "name": "Barbados",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 13.039844, "south": 13.039844,
@ -320,7 +320,7 @@
"code": "BQ", "code": "BQ",
"name": "Bonaire, Saint Eustatius and Saba", "name": "Bonaire, Saint Eustatius and Saba",
"country": "Netherlands", "country": "Netherlands",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 12.0255536, "south": 12.0255536,
@ -396,7 +396,7 @@
"code": "VG", "code": "VG",
"name": "British Virgin Islands", "name": "British Virgin Islands",
"country": "United Kingdom", "country": "United Kingdom",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 18.312737, "south": 18.312737,
@ -541,7 +541,7 @@
"code": "KY", "code": "KY",
"name": "Cayman Islands", "name": "Cayman Islands",
"country": "United Kingdom", "country": "United Kingdom",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 19.2604285, "south": 19.2604285,
@ -633,10 +633,10 @@
"region": "South-Eastern Asia", "region": "South-Eastern Asia",
"continent": "Asia", "continent": "Asia",
"type": "dependent", "type": "dependent",
"south": -0.1709691, "south": -12.2118513,
"west": -95.262501, "west": 96.8134117,
"north": 11.1831224, "north": -11.819973,
"east": -78.870899 "east": 96.9327164
}, },
{ {
"code": "CO", "code": "CO",
@ -706,7 +706,7 @@
{ {
"code": "CU", "code": "CU",
"name": "Cuba", "name": "Cuba",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 19.6529, "south": 19.6529,
@ -718,7 +718,7 @@
"code": "CW", "code": "CW",
"name": "Curaçao", "name": "Curaçao",
"country": "Netherlands", "country": "Netherlands",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 12.0379775, "south": 12.0379775,
@ -754,10 +754,10 @@
"region": "Eastern Europe", "region": "Eastern Europe",
"continent": "Europe", "continent": "Europe",
"type": "former", "type": "former",
"south": 14.4799532, "south": 47.7313888,
"west": 121.0386376, "west": 12.090991199999962,
"north": 14.4807586, "north": 51.055648,
"east": 121.0394941 "east": 22.55893370000001
}, },
{ {
"code": "CI", "code": "CI",
@ -776,10 +776,10 @@
"region": "Western Africa", "region": "Western Africa",
"continent": "Africa", "continent": "Africa",
"type": "former", "type": "former",
"south": 29.280647, "south": 6.2061,
"west": -81.0608512, "west": 0.7766672,
"north": 29.281923, "north": 12.4084434,
"east": -81.0589702 "east": 3.843343
}, },
{ {
"code": "CD", "code": "CD",
@ -787,10 +787,10 @@
"region": "Middle Africa", "region": "Middle Africa",
"continent": "Africa", "continent": "Africa",
"type": "sovereign", "type": "sovereign",
"south": -13.4580558, "south": -5.0964,
"west": 12.1454, "west": 11.1182,
"north": 5.3813889, "north": 3.7130558,
"east": 31.3208323 "east": 18.6436111
}, },
{ {
"code": "DK", "code": "DK",
@ -827,7 +827,7 @@
{ {
"code": "DM", "code": "DM",
"name": "Dominica", "name": "Dominica",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 15.20169, "south": 15.20169,
@ -838,7 +838,7 @@
{ {
"code": "DO", "code": "DO",
"name": "Dominican Republic", "name": "Dominican Republic",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 17.3611, "south": 17.3611,
@ -972,10 +972,10 @@
"name": "European Union", "name": "European Union",
"continent": "Europe", "continent": "Europe",
"type": "other", "type": "other",
"south": 0.3065863, "south": 33.8978,
"west": 32.5726145, "west": -28.0371,
"north": 0.3289019, "north": 82.7021697,
"east": 32.6046293 "east": 74.1357
}, },
{ {
"code": "FK", "code": "FK",
@ -1191,7 +1191,7 @@
{ {
"code": "GD", "code": "GD",
"name": "Grenada", "name": "Grenada",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 11.9829051, "south": 11.9829051,
@ -1203,7 +1203,7 @@
"code": "GP", "code": "GP",
"name": "Guadeloupe", "name": "Guadeloupe",
"country": "France", "country": "France",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 15.742032, "south": 15.742032,
@ -1281,7 +1281,7 @@
{ {
"code": "HT", "code": "HT",
"name": "Haiti", "name": "Haiti",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 17.9422, "south": 17.9422,
@ -1448,7 +1448,7 @@
{ {
"code": "JM", "code": "JM",
"name": "Jamaica", "name": "Jamaica",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 17.6688854, "south": 17.6688854,
@ -1486,10 +1486,10 @@
"region": "Mictonesia", "region": "Mictonesia",
"continent": "Oceania", "continent": "Oceania",
"type": "former", "type": "former",
"south": 41.8674326, "south": 16.726549,
"west": -71.4951191, "west": -169.543488,
"north": 41.8685585, "north": 16.741133,
"east": -71.4934976 "east": -169.517105
}, },
{ {
"code": "JO", "code": "JO",
@ -1542,8 +1542,8 @@
"continent": "Asia", "continent": "Asia",
"type": "former", "type": "former",
"south": 33.0041, "south": 33.0041,
"west": 124.8541, "west": 124.10159999999996,
"north": 38.634, "north": 43.01159,
"east": 131.1603 "east": 131.1603
}, },
{ {
@ -1782,7 +1782,7 @@
"code": "MQ", "code": "MQ",
"name": "Martinique", "name": "Martinique",
"country": "France", "country": "France",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 14.370834, "south": 14.370834,
@ -1830,10 +1830,10 @@
"country": "France", "country": "France",
"continent": "Europe", "continent": "Europe",
"type": "former", "type": "former",
"south": 40.7456521, "south": 41.3253,
"west": -74.0027104, "west": -5.5591,
"north": 40.7625568, "north": 51.1242,
"east": -73.9706956 "east": 9.6625
}, },
{ {
"code": "MX", "code": "MX",
@ -1916,7 +1916,7 @@
"code": "MS", "code": "MS",
"name": "Montserrat", "name": "Montserrat",
"country": "United Kingdom", "country": "United Kingdom",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 16.671007, "south": 16.671007,
@ -2016,7 +2016,7 @@
"code": "ANHH", "code": "ANHH",
"name": "Netherlands Antilles", "name": "Netherlands Antilles",
"country": "Netherlands", "country": "Netherlands",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "former", "type": "former",
"south": 11.8996035, "south": 11.8996035,
@ -2030,10 +2030,10 @@
"region": "Western Asia", "region": "Western Asia",
"continent": "Asia", "continent": "Asia",
"type": "former", "type": "former",
"south": 41.7662061, "south": 28.7778378,
"west": -88.0093504, "west": 44.7373584,
"north": 41.7828488, "north": 29.1965989,
"east": -87.9773356 "east": 46.5157382
}, },
{ {
"code": "NC", "code": "NC",
@ -2215,10 +2215,10 @@
"region": "Micronesia", "region": "Micronesia",
"continent": "Oceania", "continent": "Oceania",
"type": "former", "type": "former",
"south": 34.1376871, "south": 0.1538084,
"west": -118.2719774, "west": 131.8579102,
"north": 34.1561559, "north": 20.6584862,
"east": -118.2399626 "east": 172.57324219999998
}, },
{ {
"code": "PK", "code": "PK",
@ -2248,10 +2248,10 @@
"region": "Western Asia", "region": "Western Asia",
"continent": "Asia", "continent": "Asia",
"type": "unrecognized", "type": "unrecognized",
"south": 41.6066805, "south": 39.0213318,
"west": -93.8545674, "west": -81.4229474,
"north": 41.6233644, "north": 39.0386672,
"east": -93.8225526 "east": -81.3909326
}, },
{ {
"code": "PA", "code": "PA",
@ -2356,7 +2356,7 @@
"code": "PR", "code": "PR",
"name": "Puerto Rico", "name": "Puerto Rico",
"country": "United States", "country": "United States",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 17.831509, "south": 17.831509,
@ -2381,10 +2381,10 @@
"region": "Middle Africa", "region": "Middle Africa",
"continent": "Africa", "continent": "Africa",
"type": "sovereign", "type": "sovereign",
"south": -13.4580558, "south": -5.0964,
"west": 12.1454, "west": 11.1182,
"north": 5.3813889, "north": 3.7130558,
"east": 31.3208323 "east": 18.6436111
}, },
{ {
"code": "RHZW", "code": "RHZW",
@ -2448,16 +2448,16 @@
"region": "Northern Africa", "region": "Northern Africa",
"continent": "Aftica", "continent": "Aftica",
"type": "unrecognized", "type": "unrecognized",
"south": 31.0703727, "south": 20.427,
"west": 29.7417067, "west": -17.4573,
"north": 31.0755357, "north": 27.7224,
"east": 29.7507411 "east": -8.6666659
}, },
{ {
"code": "BL", "code": "BL",
"name": "Saint Barthélemy", "name": "Saint Barthélemy",
"country": "France", "country": "France",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 17.878453, "south": 17.878453,
@ -2480,7 +2480,7 @@
{ {
"code": "KN", "code": "KN",
"name": "Saint Kitts and Nevis", "name": "Saint Kitts and Nevis",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 17.0786101, "south": 17.0786101,
@ -2491,7 +2491,7 @@
{ {
"code": "LC", "code": "LC",
"name": "Saint Lucia", "name": "Saint Lucia",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 13.704778, "south": 13.704778,
@ -2503,7 +2503,7 @@
"code": "MF", "code": "MF",
"name": "Saint Martin", "name": "Saint Martin",
"country": "France", "country": "France",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 18.047626, "south": 18.047626,
@ -2526,7 +2526,7 @@
{ {
"code": "VC", "code": "VC",
"name": "Saint Vincent and the Grenadines", "name": "Saint Vincent and the Grenadines",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 12.5143467, "south": 12.5143467,
@ -2606,10 +2606,10 @@
"name": "Serbia and Montenegro", "name": "Serbia and Montenegro",
"continent": "Europe", "continent": "Europe",
"type": "former", "type": "former",
"south": 28.5906624, "south": 41.8297,
"west": 77.1884148, "west": 18.43398000000002,
"north": 28.5934162, "north": 46.189446,
"east": 77.1918455 "east": 23.006391500000063
}, },
{ {
"code": "SC", "code": "SC",
@ -2628,10 +2628,10 @@
"region": "South-Eastern Asia", "region": "South-Eastern Asia",
"continent": "Asia", "continent": "Asia",
"type": "former", "type": "former",
"south": 36.3389019, "south": 5.612787,
"west": -82.1661361, "west": 97.343396,
"north": 36.3568759, "north": 20.465143,
"east": -82.1341213 "east": 105.636812
}, },
{ {
"code": "SL", "code": "SL",
@ -2670,7 +2670,7 @@
"code": "SX", "code": "SX",
"name": "Sint Maarten", "name": "Sint Maarten",
"country": "Netherlands", "country": "Netherlands",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 18.047626, "south": 18.047626,
@ -2805,10 +2805,10 @@
"region": "Eastern Europe", "region": "Eastern Europe",
"continent": "Europe", "continent": "Europe",
"type": "former", "type": "former",
"south": 51.2136541, "south": 35.12876,
"west": 51.347512, "west": 19.61609999999996,
"north": 51.2276311, "north": 82.1673907,
"east": 51.3795268 "east": -168.97788000000003
}, },
{ {
"code": "ES", "code": "ES",
@ -3023,7 +3023,7 @@
{ {
"code": "TT", "code": "TT",
"name": "Trinidad and Tobago", "name": "Trinidad and Tobago",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "sovereign", "type": "sovereign",
"south": 10.0422188, "south": 10.0422188,
@ -3080,7 +3080,7 @@
"code": "TC", "code": "TC",
"name": "Turks and Caicos Islands", "name": "Turks and Caicos Islands",
"country": "United Kingdom", "country": "United Kingdom",
"region": "Carribean", "region": "Caribbean",
"continent": "Oceania", "continent": "Oceania",
"type": "dependent", "type": "dependent",
"south": 21.1459922, "south": 21.1459922,
@ -3138,10 +3138,10 @@
"region": "Northern Europe", "region": "Northern Europe",
"continent": "Europe", "continent": "Europe",
"type": "sovereign", "type": "sovereign",
"south": 34.5614, "south": 49.8825312,
"west": -8.8989, "west": -8.662663000000066,
"north": 60.9157, "north": 60.86165,
"east": 33.916555 "east": 1.768925999999965
}, },
{ {
"code": "UK", "code": "UK",
@ -3149,10 +3149,10 @@
"region": "Northern Europe", "region": "Northern Europe",
"continent": "Europe", "continent": "Europe",
"type": "other", "type": "other",
"south": 34.5614, "south": 49.8825312,
"west": -8.8989, "west": -8.662663000000066,
"north": 60.9157, "north": 60.86165,
"east": 33.916555 "east": 1.768925999999965
}, },
{ {
"code": "US", "code": "US",
@ -3170,10 +3170,10 @@
"name": "United States Minor Outlying Islands", "name": "United States Minor Outlying Islands",
"country": "United States", "country": "United States",
"type": "dependent", "type": "dependent",
"south": 17.831509, "south": -0.389006,
"west": -67.998751, "west": 166.593323,
"north": 18.568002, "north": 28.398027,
"east": -65.168503 "east": -75
}, },
{ {
"code": "PUUM", "code": "PUUM",
@ -3190,7 +3190,7 @@
"code": "VI", "code": "VI",
"name": "United States Virgin Islands", "name": "United States Virgin Islands",
"country": "United States", "country": "United States",
"region": "Carribean", "region": "Caribbean",
"continent": "North America", "continent": "North America",
"type": "dependent", "type": "dependent",
"south": 17.623468, "south": 17.623468,
@ -3326,10 +3326,10 @@
"region": "Southern Europe", "region": "Southern Europe",
"continent": "Europe", "continent": "Europe",
"type": "former", "type": "former",
"south": 42.231503, "south": 40.855222,
"west": 18.850952, "west": 13.364900000000034,
"north": 46.189446, "north": 46.8766467,
"east": 23.0063915 "east": 23.034092999999984
}, },
{ {
"code": "ZRCD", "code": "ZRCD",