add Ox.ArrayInput, more Ox.ListMap UI
This commit is contained in:
parent
ce3bdb46d6
commit
6a33b9cb97
8 changed files with 381 additions and 101 deletions
|
|
@ -1,16 +1,17 @@
|
|||
Ox.load('UI', {
|
||||
debug: true,
|
||||
hideScreen: true,
|
||||
showScreen: true,
|
||||
theme: 'modern'
|
||||
}, function() {
|
||||
|
||||
Ox.getJSON('json/cities100000.json', function(data) {
|
||||
Ox.load('Geo', function() {
|
||||
|
||||
Ox.getJSON('json/cities1000000.json', function(data) {
|
||||
|
||||
var listmap = new Ox.ListMap({
|
||||
height: window.innerHeight,
|
||||
places: data.map(function(city) {
|
||||
var marker = city.population > 20000000 ? {size: 24, color: [255, 0, 0]} :
|
||||
var countryCode = city.country_code == 'XK' ? 'RS-KO' : city.country_code,
|
||||
marker = city.population > 20000000 ? {size: 24, color: [255, 0, 0]} :
|
||||
city.population > 10000000 ? {size: 22, color: [255, 32, 0]} :
|
||||
city.population > 5000000 ? {size: 20, color: [255, 64, 0]} :
|
||||
city.population > 2000000 ? {size: 18, color: [255, 96, 0]} :
|
||||
|
|
@ -23,10 +24,10 @@ Ox.load('UI', {
|
|||
latSize = size / Ox.EARTH_CIRCUMFERENCE * 360,
|
||||
lngSize = size * Ox.getDegreesPerMeter(city.latitude);
|
||||
return {
|
||||
countryCode: city.country_code == 'XK' ? 'RS-KO' : city.country_code,
|
||||
countryCode: countryCode,
|
||||
editable: true,
|
||||
flag: city.country_code,
|
||||
geoname: city.name,
|
||||
flag: countryCode,
|
||||
geoname: city.name + ', ' + Ox.getCountryByCode(countryCode).name,
|
||||
markerColor: marker.color,
|
||||
markerSize: marker.size,
|
||||
name: city.name,
|
||||
|
|
@ -49,6 +50,7 @@ Ox.load('UI', {
|
|||
}
|
||||
})
|
||||
.appendTo(Ox.UI.$body);
|
||||
|
||||
$(window).resize(function() {
|
||||
Ox.print('RESIZE', window.innerHeight)
|
||||
listmap.options({
|
||||
|
|
@ -58,5 +60,8 @@ Ox.load('UI', {
|
|||
});
|
||||
|
||||
window.listmap = listmap;
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue