Nicer background-* handling

This commit is contained in:
Komzpa 2011-08-10 02:45:29 +03:00
parent 63d95fb4ab
commit 6e091a7a69
2 changed files with 8 additions and 13 deletions

View file

@ -340,22 +340,17 @@ if options.renderer == "mapnik":
continue
elif zlayer not in range(-5,6):
continue
if entry["type"] in ("way", "area", "polygon"):
if "fill-color" in entry["style"] or "fill-image" in entry["style"]:
xml += xml_rule_start()
xml += x_scale
xml += xml_filter(entry["rulestring"])
if "fill-color" in entry["style"]:
xml += xml_polygonsymbolizer(entry["style"].get("fill-color", "black"), entry["style"].get("fill-opacity", "1"))
if "fill-image" in entry["style"]:
xml += xml_polygonpatternsymbolizer(entry["style"].get("fill-image", ""))
sql.add(entry["sql"])
itags.update(entry["chooser"].get_interesting_tags(entry["type"], zoom))
xml += xml_rule_end()
if "width" in entry["style"] or "line-style" in entry["style"]:
xml += xml_rule_start()
xml += x_scale
xml += xml_filter(entry["rulestring"])
if entry["type"] in ("way", "area", "polygon"):
if "fill-color" in entry["style"]:
xml += xml_polygonsymbolizer(entry["style"].get("fill-color", "black"), entry["style"].get("fill-opacity", "1"))
if "fill-image" in entry["style"]:
xml += xml_polygonpatternsymbolizer(entry["style"].get("fill-image", ""))
if "width" in entry["style"]:
xml += xml_linesymbolizer(color=entry["style"].get("color", "black"),
width=entry["style"].get("width", "1"),

View file

@ -83,7 +83,7 @@ class StyleChooser:
"""
a = set()
b = ""
needed = set(["width", "casing-width", "fill-color", "fill-image", "icon-image", "text", "extrude"])
needed = set(["width", "casing-width", "fill-color", "fill-image", "icon-image", "text", "extrude", "background-image", "background-color"])
if not needed.isdisjoint(set(self.styles[0].keys())):
for c in self.ruleChains: