From 4831fb48d62bd8946689a9e6d9ac591d2716e89b Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Mon, 23 Sep 2013 17:00:29 +0300 Subject: [PATCH] map key generator update --- src/generate_map_key.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/generate_map_key.py b/src/generate_map_key.py index f88e06c..0054f40 100644 --- a/src/generate_map_key.py +++ b/src/generate_map_key.py @@ -34,10 +34,12 @@ cr.translate(0,0.5) i = 0 +icons = {} for tag in tags: had_lines = False for zoom in range (minzoom, maxzoom): - styles = style.get_style_dict("area", tag, zoom, olddict = {}) + styles = style.get_style_dict("node", tag, zoom, olddict = {}) + styles = style.get_style_dict("area", tag, zoom, olddict = styles.copy()) styles = style.get_style_dict("line", tag, zoom, olddict = styles.copy()) styles = styles.values() @@ -73,6 +75,10 @@ for tag in tags: cr.line_to(sample_width+sample_width*zoom, 50+50*i) had_lines = True cr.stroke() + if "icon-image" in st: + icons[st["icon-image"]] = icons.get(st["icon-image"], set()) + icons[st["icon-image"]].add('[' + ']['.join([ k+"="+v for k,v in tag.iteritems()])+']') + if had_lines: cr.move_to(0+sample_width*zoom, 25+50*i) @@ -91,5 +97,10 @@ for tag in tags: cr.stroke() i += 1 -#a.finish() +#a.finish()\ +ss = open("icons.html","w") +print >> ss, "" +for k, v in icons.iteritems(): + print >> ss, "\n"%(k.lower(), k.lower(), "
".join(list(v))) +print >> ss, "
%s%s
" a.write_to_png ("legend.png") \ No newline at end of file