oxjs/demos/listmap/js/listmap.js
2011-05-24 12:44:34 +02:00

51 lines
No EOL
1.5 KiB
JavaScript

Ox.load('UI', {
debug: true,
theme: 'modern'
}, function() {
Ox.load('Geo', function() {
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
};
}),
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.listmap = listmap;
});
});