From 56656da92563e172bbb7569d3a74df8d24785d3f Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 19 Sep 2015 02:57:07 +0200 Subject: [PATCH] datenspuren: food improvements --- Makefile | 2 +- content/static/datenspuren/2015/script/pois.js | 9 ++++++--- content/static/datenspuren/2015/style/style.css | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4f4db2adf..36ac6a02a 100644 --- a/Makefile +++ b/Makefile @@ -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)) diff --git a/content/static/datenspuren/2015/script/pois.js b/content/static/datenspuren/2015/script/pois.js index cbe2dcedc..8083b0ce9 100644 --- a/content/static/datenspuren/2015/script/pois.js +++ b/content/static/datenspuren/2015/script/pois.js @@ -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 = $('') diff --git a/content/static/datenspuren/2015/style/style.css b/content/static/datenspuren/2015/style/style.css index c15f6371c..cec72230c 100644 --- a/content/static/datenspuren/2015/style/style.css +++ b/content/static/datenspuren/2015/style/style.css @@ -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 {