Welcome to Advanced Interactive Web Mapping, Programming, and Design, Class 11
This is a web page that can be viewed as slides.
→ to move forward
← to go back
Class 11
<p>
<span>{{name}}</span>:
<span>{{job}}</span>
</p>
<p>
<span>{{name}}</span>:
<span>{{job}}</span>
</p>
<p>
<span>{{name}}</span>:
<span>{{job}}</span>
</p>
...
var context = {
name: "Frank",
job: "milkman"
};
<p>
<span>Frank</span>:
<span>milkman</span>
</p>
script
tag$('#template').html()
template
tag{{#rows}}
<li>{{name}}</li>
{{/rows}}
{{#rows}}
<li>{{name}}</li>
{{/rows}}
var context = {
rows: [
{ name: 'Frank' },
{ name: 'Jane' }
]
};
<li>Frank</li>
<li>Jane</li>
{{#url}}
<a href="{{url}}">{{name}}</a>
{{/url}}
SELECT neighbourhood,
ST_Convexhull(
ST_Collect(the_geom_webmercator)
) AS the_geom_webmercator
FROM listings
GROUP BY neighbourhood
var feature; // Assuming this exists
var buffered = turf.buffer(feature);
var feature; // Assuming this exists
var buffered = turf.buffer(feature);
// Then we can treat buffered like
// GeoJSON we got from $.getJSON()
L.geoJson(buffered).addTo(map);
var feature; // Assuming this exists
var turfLayer = L.geoJson(null).addTo(map);
var buffered = turf.buffer(feature);
turfLayer.addData(buffered);
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [102.0, 0.5]
},
"properties": {"prop0": "value0"}
}
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [ /* array */ ]
},
"properties": {"prop0": "value0"}
}
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [ /* array */ ]
},
"properties": {"prop0": "value0"}
}
{
"type": "FeatureCollection",
"features": [ /* features */ ]
}
$.getJSON(url, function (data) {
// If the url points to valid GeoJSON,
// data is a GeoJSON object
});
var dataLayer = L.geoJson(data).addTo(map);
var geojson = dataLayer.toGeoJson();
turf.point([-75.343, 39.984]);