minor reformatting

This commit is contained in:
rolux 2012-05-30 15:18:26 +02:00
parent 9269b96469
commit 6c44f683d6

View file

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