minor reformatting
This commit is contained in:
parent
9269b96469
commit
6c44f683d6
1 changed files with 13 additions and 12 deletions
|
@ -28,18 +28,19 @@ Ox.load({UI: {showScreen: true}, Geo: {}}, function() {
|
||||||
*/
|
*/
|
||||||
cities = cities.map(function(data, id) {
|
cities = cities.map(function(data, id) {
|
||||||
/*
|
/*
|
||||||
First of all, we have to patch this data, so that it becomes more useful
|
First of all, we have to patch this data, so that it becomes more
|
||||||
both for the list and the map. Ox.getCountryByCode gives us the names of
|
useful both for the list and the map. Ox.getCountryByCode gives us
|
||||||
the country, region and continent. For the map, we need a geoname, and
|
the names of the country, region and continent. For the map, we need
|
||||||
the cities have to be rectangular areas, not just points. So we set the
|
a geoname, and the cities have to be rectangular areas, not just
|
||||||
area to 100 square meters per inhabitant, which will turn out to be
|
points. So we set the area to 100 square meters per inhabitant,
|
||||||
relatively realistic. Then we calculate how large the resulting square
|
which will turn out to be relatively realistic. Then we calculate
|
||||||
will be, in degrees. (The number of degrees from west to east depends on
|
how large the resulting square will be, in degrees. (The number of
|
||||||
the city's proximity to the equator. OxJS has some utility functions
|
degrees from west to east depends on the city's proximity to the
|
||||||
built in that make this easy to compute.) Finally, we can set the values
|
equator. OxJS has some utility functions built in that make this
|
||||||
for south, north, west and east. A nice side effect of deriving the size
|
easy to compute.) Finally, we can set the values for south, north,
|
||||||
of the city from its population is that the map, which will always show
|
west and east. A nice side effect of deriving the size of the city
|
||||||
the largest places in the visible area, will now show the most populated
|
from its population is that the map, which will always show the
|
||||||
|
largest places in the visible area, will now show the most populated
|
||||||
cities.
|
cities.
|
||||||
*/
|
*/
|
||||||
var area = Math.max(data.population, 1) * 100,
|
var area = Math.max(data.population, 1) * 100,
|
||||||
|
|
Loading…
Reference in a new issue