Welcome to Advanced GIS, Lecture 3
This is a web page that can be viewed as slides.
→ to move forward
← to go back
download this data: bit.ly/advgis-airbnb
rename the file airbnb.csv and upload it to your CartoDB account
#ne10murbanareas{ marker-width: 3; ... [zoom >= 10] { marker-width: 8; } [zoom >= 16] { marker-width: 13; }
#ne10murbanareas{ marker-width: 3; ... [zoom >= 10] { marker-width: 8; } [zoom >= 16] { marker-width: 13; }
#ne10murbanareas{ marker-width: 3; ... [zoom >= 10] { marker-width: 8; } [zoom >= 16] { marker-width: 13; } }
#airbnb { marker-width: 3; ... [zoom >= 10] { marker-width: 8; } }
#airbnb { marker-width: 3; ... [zoom >= 10][zoom < 16] { marker-width: 8; } }
#airbnb { marker-width: 3; ... [zoom >= 10][zoom < 16] { marker-width: 8; } }
markers are 3 pixels wide. if the map is between zoom level 10 and 16, the markers are 8 pixels wide.
#airbnb { marker-width: 3; ... [price >= 50] { marker-width: 8; } }
#airbnb { marker-width: 3; ... [price >= 50][price <= 100] { marker-width: 8; } }
#airbnb { marker-width: 3; ... [price >= 50][neighbourhood = 'Bedford-Stuyvesant'] { marker-width: 8; } }
#airbnb { marker-width: 3; ... [price >= 50], [neighbourhood = 'Bedford-Stuyvesant'] { marker-width: 8; } }
shortcut for:
#airbnb { marker-width: 3; ... [price >= 50] { marker-width: 8; } [neighbourhood = 'Bedford-Stuyvesant'] { marker-width: 8; } }
#airbnb { marker-width: 3; ... [price >= 50], [neighbourhood = 'Bedford-Stuyvesant'] { marker-width: 8; } }
markers with price over 50 are larger
also markers in Bed-Stuy are larger
[mag >= 5.5] { ... }
[price >= 50][price <= 100] { ... }
both conditions must be true
[price >= 50], [zoom >= 10] { ... }
either condition could be true
#airbnb { marker-width: 5; marker-fill: #ff307a; marker-allow-overlap: true; [zoom >= 4] { marker-width: 10; } [zoom >= 8] { marker-width: 15; } [zoom >= 12] { marker-width: 20; } }
#airbnb { marker-width: 6; marker-fill: #ff307a; marker-allow-overlap: true; [zoom >= 4] { marker-width: 12; } [zoom >= 8] { marker-width: 18; } [zoom >= 12] { marker-width: 24; } }
@width: 6; #airbnb { marker-width: @width; marker-fill: #ff307a; marker-allow-overlap: true; [zoom >= 4] { marker-width: 12; } [zoom >= 8] { marker-width: 18; } [zoom >= 12] { marker-width: 24; } }
@width: 6; #airbnb { marker-width: @width; marker-fill: #ff307a; marker-allow-overlap: true; [zoom >= 4] { marker-width: @width * 2; } [zoom >= 8] { marker-width: @width * 3; } [zoom >= 12] { marker-width: @width * 4; } }
@width: 8; #airbnb { marker-width: @width; marker-fill: #ff307a; marker-allow-overlap: true; [zoom >= 4] { marker-width: @width * 2; } [zoom >= 8] { marker-width: @width * 3; } [zoom >= 12] { marker-width: @width * 4; } }
@airbnbcolor: #ff307a; #airbnb { marker-width: @width; marker-fill: @airbnbcolor; marker-line-color: @airbnbcolor; marker-line-opacity: 0.2; marker-allow-overlap: true; }
@airbnbcolor: #ff307a; #airbnb { marker-width: @width; marker-fill: fadeout(@airbnbcolor, 25%); marker-line-color: @airbnbcolor; marker-line-opacity: 0.2; marker-allow-overlap: true; }
other color functions:
(a very short introduction)
let's look at it with Chrome's Developer Tools:
Tools > Developer Tools
defines the structure of a page, loads other bits
adds style to parts of a page
makes web pages dynamic (eg AJAX)
your browser loads the HTML, which tells it which CSS and JavaScript files to get (if any)
inside a Google data center, via Wired
can give you an idea of the route data takes to get from you to the server (and vice versa)
2008: an "internet blackout [...] left 75 million people with only limited access, caused by a ship that tried to moor off the coast of Egypt in bad weather"
The Guardian2008: an "internet blackout [...] left 75 million people with only limited access, caused by a ship that tried to moor off the coast of Egypt in bad weather"
The Guardianhow undersea cables are laid
(a few of these slides are adapted from these excellent Maptime slides)
http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png
http://a.tile.stamen.com/toner/0/0/0.png