forked from 0x2620/oxjs
fixes for list and map
This commit is contained in:
parent
e815b2f2e1
commit
6496f4d0f6
4 changed files with 1350 additions and 436 deletions
|
|
@ -1,48 +1,37 @@
|
|||
$(function() {
|
||||
Ox.theme('modern');
|
||||
var listmap = new Ox.ListMap({
|
||||
height: window.innerHeight,
|
||||
places: [
|
||||
{
|
||||
editable: true,
|
||||
flag: 'UK',
|
||||
geoname: 'Westminster, London, UK',
|
||||
id: '0',
|
||||
name: 'London',
|
||||
//lat: 51.5001524,
|
||||
lat: 51.52670875,
|
||||
lng: -0.1262362,
|
||||
south: 51.3493528,
|
||||
west: -0.378358,
|
||||
north: 51.7040647,
|
||||
east: 0.1502295
|
||||
},
|
||||
{
|
||||
editable: false,
|
||||
flag: 'FR',
|
||||
geoname: 'Paris, France',
|
||||
id: '1',
|
||||
name: 'Paris',
|
||||
lat: 48.8566667,
|
||||
lng: 2.3509871,
|
||||
south: 48.8155414,
|
||||
west: 2.2241006,
|
||||
north: 48.9021461,
|
||||
east: 2.4699099,
|
||||
}
|
||||
],
|
||||
width: window.innerWidth
|
||||
})
|
||||
.appendTo($('body'));
|
||||
$.getJSON('../map/json/countries.json', function(data) {
|
||||
|
||||
$(window).resize(function() {
|
||||
Ox.print('RESIZE', window.innerHeight)
|
||||
listmap.options({
|
||||
height: window.innerHeight,
|
||||
width: window.innerWidth
|
||||
Ox.theme('modern');
|
||||
var listmap = new Ox.ListMap({
|
||||
height: window.innerHeight,
|
||||
places: data.map(function(place) {
|
||||
return Ox.extend({
|
||||
countryCode: place.code,
|
||||
editable: true,
|
||||
flag: place.code,
|
||||
geoname: place.name,
|
||||
name: place.name,
|
||||
size: place.size,
|
||||
type: 'country',
|
||||
lat: place.lat,
|
||||
lng: place.lng,
|
||||
south: place.south,
|
||||
west: place.west,
|
||||
north: place.north,
|
||||
east: place.east
|
||||
});
|
||||
}),
|
||||
width: window.innerWidth
|
||||
})
|
||||
.appendTo($('body'));
|
||||
$(window).resize(function() {
|
||||
Ox.print('RESIZE', window.innerHeight)
|
||||
listmap.options({
|
||||
height: window.innerHeight,
|
||||
width: window.innerWidth
|
||||
});
|
||||
});
|
||||
|
||||
window.listmap = listmap;
|
||||
});
|
||||
|
||||
window.listmap = listmap;
|
||||
|
||||
});
|
||||
|
|
@ -10,9 +10,15 @@ $(function() {
|
|||
height: height,
|
||||
places: data.map(function(place) {
|
||||
return Ox.extend({
|
||||
countryCode: place.code,
|
||||
editable: true,
|
||||
flag: place.code,
|
||||
geoname: place.name,
|
||||
name: place.name,
|
||||
size: place.size,
|
||||
type: 'Country',
|
||||
lat: place.lat,
|
||||
lng: place.lng,
|
||||
south: place.south,
|
||||
west: place.west,
|
||||
north: place.north,
|
||||
|
|
@ -73,7 +79,7 @@ $(function() {
|
|||
sizeNorthSouth: data.sizeNorthSouth,
|
||||
south: data.south,
|
||||
west: data.west,
|
||||
types: data.types
|
||||
type: data.type
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue