datenspuren: food improvements

This commit is contained in:
Astro 2015-09-19 02:57:07 +02:00
parent 770068bf9a
commit 56656da925
3 changed files with 9 additions and 5 deletions

View File

@ -306,7 +306,7 @@ build/datenspuren/2014/mitschnitte-rss.xml: content/news/ds14-mitschnitte-online
$(call xml_process)
build/datenspuren/$(DS_YEAR)/pois.json:
wget -O $@ --post-data="data=[out:json];($(foreach a, 'amenity'='restaurant' 'amenity'='fast_food' 'amenity'='cafe' 'amenity'='ice_cream' 'amenity'='bakery' 'shop'='convenience' 'shop'='supermarket', node(51.01,13.76,51.07,13.82)[${a}];));out;" http://overpass-api.de/api/interpreter
wget -O $@ --post-data="data=[out:json];($(foreach a, 'amenity'='restaurant' 'amenity'='fast_food' 'amenity'='cafe' 'amenity'='ice_cream' 'amenity'='bakery' 'shop'='convenience' 'shop'='supermarket' 'shop'='tobacco' 'amenity'='pub' 'amenity'='biergarten' 'amenity'='drinking_water', $(foreach t, node way relation, $t(51.01,13.76,51.07,13.82)[${a}];)));out center qt;" http://overpass-api.de/api/interpreter
xhtml5-validate: $(patsubst build/%.html, build/%.html.xhtml5-validate, $(CONTENT))

View File

@ -6,11 +6,13 @@ var geoListeners = []
function POI(info) {
this.info = info
this.lon = info.lon || info.center.lon
this.lat = info.lat || info.center.lat
}
POI.prototype.getDistance = function() {
return WGS84Util.distanceBetween({
coordinates: [this.info.lon, this.info.lat]
coordinates: [this.lon, this.lat]
}, {
coordinates: [currentPosition.lon, currentPosition.lat]
})
@ -21,8 +23,8 @@ POI.prototype.makeArrowEl = function() {
var update = function() {
var bearing = -180.0 * Math.atan2(
this.info.lat - currentPosition.lat,
this.info.lon - currentPosition.lon
this.lat - currentPosition.lat,
this.lon - currentPosition.lon
) / Math.PI
el.find('.arrow span').css('transform', 'rotate(' + (bearing - (currentPosition.heading || 0)) + 'deg)')
if (typeof currentPosition.heading === 'number')
@ -107,6 +109,7 @@ h3.click(function() {
dt.find('a').
attr('href', "https://www.openstreetmap.org/" + poi.info.type + "/" + poi.info.id).
text(poi.info.tags.name)
// TODO: ♿
if (poi.info.tags['addr:street'] && poi.info.tags['addr:housenumber']) {
var addr = $('<span class="addr"></span>')

View File

@ -146,7 +146,7 @@ footer a {
#food dt {
clear: both;
margin-top: 0.5em;
margin-top: 1em;
font-weight: bold;
}
#food dt .addr, #food dt .website {
@ -157,6 +157,7 @@ footer a {
#food dd {
color: #444;
font-size: 80%;
margin: 0;
}
.geo-arrow {