oxjs/demos/listmap/js/listmap.js

51 lines
1.5 KiB
JavaScript
Raw Normal View History

2011-05-23 19:38:52 +00:00
Ox.load('UI', {
debug: true,
theme: 'modern'
}, function() {
Ox.load('Geo', function() {
2011-03-05 08:53:34 +00:00
2011-03-05 15:34:16 +00:00
var listmap = new Ox.ListMap({
height: window.innerHeight,
2011-05-23 19:38:52 +00:00
places: Ox.map(Ox.COUNTRIES, function(place) {
return {
2011-05-24 10:44:34 +00:00
alternativeNames: place.googleName ? [place.googleName] : [],
2011-05-23 19:38:52 +00:00
area: place.area,
2011-03-05 15:34:16 +00:00
countryCode: place.code,
editable: true,
flag: place.code,
geoname: place.name,
2011-05-24 06:15:44 +00:00
id: place.code,
2011-03-05 15:34:16 +00:00
name: place.name,
2011-05-23 19:38:52 +00:00
type: 'Country',
2011-03-05 15:34:16 +00:00
lat: place.lat,
lng: place.lng,
south: place.south,
west: place.west,
north: place.north,
east: place.east
2011-05-23 19:38:52 +00:00
};
2011-03-05 15:34:16 +00:00
}),
width: window.innerWidth
})
2011-05-23 19:38:52 +00:00
.bindEvent({
geocode: function(event, data) {
Ox.print(event)
Ox.print(JSON.stringify(data))
}
})
.appendTo(Ox.UI.$body);
2011-03-05 15:34:16 +00:00
$(window).resize(function() {
Ox.print('RESIZE', window.innerHeight)
listmap.options({
height: window.innerHeight,
width: window.innerWidth
});
2011-03-05 08:53:34 +00:00
});
2011-03-05 15:34:16 +00:00
window.listmap = listmap;
2011-05-23 19:38:52 +00:00
2011-03-05 15:34:16 +00:00
});
2011-05-23 19:38:52 +00:00
2011-03-05 08:53:34 +00:00
});