forked from 0x2620/oxjs
improved geodata and tools
This commit is contained in:
parent
4d9a8537ef
commit
912f2121a4
47 changed files with 682294 additions and 3535 deletions
|
|
@ -3,12 +3,9 @@
|
|||
<head>
|
||||
<title>ox.js listmap demo</title
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../build/css/ox.ui.css"/>
|
||||
<script src="../../build/js/jquery-1.5.js"></script>
|
||||
<script src="../../build/js/ox.js"></script>
|
||||
<script src="../../build/js/ox.map.js"></script>
|
||||
<script src="../../build/js/ox.ui.js"></script>
|
||||
<script src="js/listmap.js"></script>
|
||||
<script type="text/javascript" src="../../build/Ox.js"></script>
|
||||
<script type="text/javascript" src="../../source/_/ox.map.js"></script>
|
||||
<script type="text/javascript" src="js/listmap.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1,29 +1,39 @@
|
|||
$(function() {
|
||||
$.getJSON('../map/json/countries.json', function(data) {
|
||||
Ox.load('UI', {
|
||||
debug: true,
|
||||
theme: 'modern'
|
||||
}, function() {
|
||||
|
||||
Ox.load('Geo', function() {
|
||||
|
||||
Ox.theme('modern');
|
||||
var listmap = new Ox.ListMap({
|
||||
height: window.innerHeight,
|
||||
places: data.map(function(place) {
|
||||
return Ox.extend({
|
||||
places: Ox.map(Ox.COUNTRIES, function(place) {
|
||||
return {
|
||||
area: place.area,
|
||||
countryCode: place.code,
|
||||
editable: true,
|
||||
flag: place.code,
|
||||
geoname: place.name,
|
||||
name: place.name,
|
||||
size: place.size,
|
||||
type: 'country',
|
||||
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'));
|
||||
.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({
|
||||
|
|
@ -33,5 +43,7 @@ $(function() {
|
|||
});
|
||||
|
||||
window.listmap = listmap;
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
@ -20,10 +20,11 @@ Ox.load('Geo', function() {
|
|||
city.population > 200000 ? {size: 12, color: [255, 192, 0]} :
|
||||
city.population > 100000 ? {size: 10, color: [255, 224, 0]} :
|
||||
{size: 8, color: [255, 255, 0]},
|
||||
size = Math.sqrt(city.population * 100),
|
||||
latSize = size / Ox.EARTH_CIRCUMFERENCE * 360,
|
||||
lngSize = size * Ox.getDegreesPerMeter(city.latitude);
|
||||
return city.population > 400000 ? {
|
||||
area = Math.sqrt(city.population * 100),
|
||||
latSize = area / Ox.EARTH_CIRCUMFERENCE * 360,
|
||||
lngSize = area * Ox.getDegreesPerMeter(city.latitude);
|
||||
return city.population > 600000/*400000*/ ? {
|
||||
area: city.population * 100,
|
||||
countryCode: countryCode,
|
||||
editable: true,
|
||||
flag: countryCode,
|
||||
|
|
@ -32,7 +33,6 @@ Ox.load('Geo', function() {
|
|||
markerColor: marker.color,
|
||||
markerSize: marker.size,
|
||||
name: city.name,
|
||||
size: city.population * 100,
|
||||
type: 'city',
|
||||
lat: city.latitude,
|
||||
lng: city.longitude,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
Ox.load('UI', {debug: true}, function() {
|
||||
Ox.load('Geo', function() {
|
||||
|
||||
$.getJSON('json/countries.json', function(data) {
|
||||
Ox.load('Geo', function() {
|
||||
|
||||
var width = window.innerWidth - 256,
|
||||
height = window.innerHeight,
|
||||
|
|
@ -9,7 +8,7 @@ Ox.load('Geo', function() {
|
|||
clickable: true,
|
||||
editable: true,
|
||||
height: height,
|
||||
places: data.map(function(place) {
|
||||
places: Ox.COUNTRIES.map(function(place) {
|
||||
return Ox.extend({
|
||||
countryCode: place.code,
|
||||
editable: true,
|
||||
|
|
@ -55,6 +54,7 @@ Ox.load('Geo', function() {
|
|||
}
|
||||
],
|
||||
*/
|
||||
showLabels: true,
|
||||
statusbar: true,
|
||||
toolbar: true,
|
||||
width: width,
|
||||
|
|
@ -127,5 +127,4 @@ Ox.load('Geo', function() {
|
|||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue