From 01420c03b3294870028d2dfbb1b644f537045e18 Mon Sep 17 00:00:00 2001 From: Komzpa Date: Tue, 27 Sep 2011 20:32:12 +0300 Subject: [PATCH] Better support for pointsymbolizers --- src/komap.py | 2 +- src/libkomapnik.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/komap.py b/src/komap.py index ad8549e..c05aa6c 100644 --- a/src/komap.py +++ b/src/komap.py @@ -479,7 +479,7 @@ if options.renderer == "mapnik": style_started = False for entry in zsheet[zindex]: if entry["type"] in entry_types: - if "icon-image" in entry["style"] and ("text" not in entry["style"] or ("text" not in entry["style"] and entry["style"].get("text-position","center")!='center')): + if "icon-image" in entry["style"] and ("text" not in entry["style"] or ("text" in entry["style"] and entry["style"].get("text-position","center")!='center')): if not prevtype: prevtype = layer_type if prevtype != layer_type: diff --git a/src/libkomapnik.py b/src/libkomapnik.py index 9531aed..3106492 100644 --- a/src/libkomapnik.py +++ b/src/libkomapnik.py @@ -125,7 +125,8 @@ def xml_linepatternsymbolizer(path=""): """%(icons_path, path) -def xml_textsymbolizer(text="name",face="DejaVu Sans Book",size="10",color="#000000", halo_color="#ffffff", halo_radius="0", placement="line", offset="0", overlap="false", distance="26", wrap_width=256, align="center", opacity="1", pos="X"): +def xml_textsymbolizer( + text="name",face="DejaVu Sans Book",size="10",color="#000000", halo_color="#ffffff", halo_radius="0", placement="line", offset="0", overlap="false", distance="26", wrap_width=256, align="center", opacity="1", pos="X"): color = nicecolor(color) halo_color = nicecolor(halo_color) pos = pos.replace("exact", "X").replace("any","S, E, X, N, W, NE, SE, NW, SW").split(",") @@ -140,7 +141,8 @@ def xml_textsymbolizer(text="name",face="DejaVu Sans Book",size="10",color="#000 """%(text,face,int(float(size)),color,halo_color,halo_radius,placement,offset,overlap,wrap_width,distance,align,opacity,pos) -def xml_shieldsymbolizer(path="", width="", height="",text="name",face="DejaVu Sans Book",size="10",color="#000000", halo_color="#ffffff", halo_radius="0", placement="line", offset="0", overlap="false", distance="26", wrap_width=256, align="center", opacity="1"): +def xml_shieldsymbolizer(path="", width="", height="", + text="name",face="DejaVu Sans Book",size="10",color="#000000", halo_color="#ffffff", halo_radius="0", placement="line", offset="0", overlap="false", distance="26", wrap_width=256, align="center", opacity="1"): color = nicecolor(color) halo_color = nicecolor(halo_color) placement = {"center": "point"}.get(placement.lower(), placement)