Welcome to Advanced GIS, Lecture 7
This is a web page that can be viewed as slides.
→ to move forward
← to go back
Class 7
+ tons of other sites with maps on them
var size = 5;
var size = 5 * 1000;
var greeting = 'Hello world';
var greeting = 'Hello world';
'
or "
var greeting = 'Hello world';
'
or "
var greeting = 'Hello world';
var greeting = "Hello world";
'
or "
var greeting = 'Hello world';
var greeting = "Hello world";
var query = 'SELECT * FROM listings';
query + ' WHERE price > 100';
var map = L.map('map');
var shark map = L.map('map');
var shark-map = L.map('map');
var sharkMap = L.map('map');
console.log()
console.log(query);
var ratings = [
5,
3,
4.5
];
var lifeStages = [
'Neonate',
'Juvenile',
'Adult'
];
var lifeStages = [
'Neonate',
'Juvenile',
'Adult'
];
lifeStages[0]
is 'Neonate'
var lifeStages = [
'Neonate',
'Juvenile',
'Adult'
];
lifeStages[1]
is 'Juvenile'
[
and ]
in JavaScript almost always mean we're making an array or getting something out of onevar coordinates = {
latitude: 41.56,
longitude: -73.29
};
var coordinates = {
latitude: 41.56,
longitude: -73.29
};
.
var coordinates = {
latitude: 41.56,
longitude: -73.29
};
coordinates.latitude
is 41.56
""
around keysvar coordinates = {
"latitude": 41.56,
"longitude": -73.29
};
var map = L.map('map', {
center: [30, 0],
zoom: 3
});
var map = L.map('map', {
center: [30, 0],
zoom: 3
});
{
and }
in JavaScript can mean many things, but for now they mean we're making an objectvar source = new carto.source.SQL('SELECT * FROM hms_efh_2009tiger_shark');
alert('NO');
console.log('The code got here');
Math.max(2, 25);
var source = new carto.source.SQL('SELECT * FROM hms_efh_2009tiger_shark');
var source = new carto.source.SQL('SELECT * FROM hms_efh_2009tiger_shark');
var source = new carto.source.SQL('SELECT * FROM hms_efh_2009tiger_shark');
source.setQuery("SELECT * FROM hms_efh_2009tiger_shark WHERE life_stage = 'Juvenile'");
<button class="juvenile-button">
just show Juvenile habitat
</button>
juvenileButton.addEventListener('click', function (e) {
...
});
juvenileButton.addEventListener('click', function (e) {
source.setQuery("SELECT * FROM hms_efh_2009tiger_shark WHERE life_stage = 'Juvenile'");
});