oxjs/demos/listmap/js/listmap.js

45 lines
No EOL
1.4 KiB
JavaScript

Ox.load({UI: {}, Geo: {}}, function() {
$listmap = new Ox.ListMap({
height: window.innerHeight,
places: Ox.COUNTRIES.map(function(place) {
return {
alternativeNames: Ox.compact([place.google, place.imdb, place.wikipedia]),
area: place.area,
countryCode: place.code,
editable: true,
flag: place.code,
geoname: place.name,
id: place.code,
markerColor: Ox.getGeoColor(place.region),
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;
});