Ox.load('UI', function() { Ox.getJSONC('../jsonc/countries.jsonc', function(data) { Ox.getJSON('../json/countries.json', function(countries) { var $map = $('') .attr({ id: 'map', src: '../png/map.png' }), $bar = Ox.Bar({size: 24}), $status = $('
' + 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();
$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 = [
$('