summaryrefslogtreecommitdiff
path: root/web/lib/ui
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-05-13 09:28:12 +0200
committerJochen Topf <jochen@topf.org>2014-05-13 09:28:12 +0200
commitb9f4796b8b2a4537b34337dc56bec475a92543e5 (patch)
treeef065e0051bbc3ea470b61dbaf966a7adeea757d /web/lib/ui
parent82dab89f663561829f24a29c079c4406bcba4a69 (diff)
downloadtaginfo-b9f4796b8b2a4537b34337dc56bec475a92543e5.tar
taginfo-b9f4796b8b2a4537b34337dc56bec475a92543e5.tar.gz
Add support for showing geo distribution of tags.
This adds all the necessary code but it is still disabled.
Diffstat (limited to 'web/lib/ui')
-rw-r--r--web/lib/ui/tags.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/lib/ui/tags.rb b/web/lib/ui/tags.rb
index 8018ab2..4250b33 100644
--- a/web/lib/ui/tags.rb
+++ b/web/lib/ui/tags.rb
@@ -20,6 +20,7 @@ class Taginfo < Sinatra::Base
@tag = @key + '=' + @value
@key_uri = escape(@key)
+ @value_uri = escape(@value)
@title = [@key + '=' + @value, t.osm.tags]
section :tags
@@ -54,6 +55,11 @@ class Taginfo < Sinatra::Base
@has_rtype_link = true
end
+ @has_map = @db.count('tag_distributions').condition('key = ?', @key).condition('value = ?', @value).get_first_value().to_i > 0
+
+ @img_width = TaginfoConfig.get('geodistribution.width') * TaginfoConfig.get('geodistribution.scale_image')
+ @img_height = TaginfoConfig.get('geodistribution.height') * TaginfoConfig.get('geodistribution.scale_image')
+
javascript_for(:flexigrid)
javascript "#{ r18n.locale.code }/tag"
erb :tag