Permalink
Browse files

Add TextSymbolizer.name in python bindings.

Refs #1482.
  • Loading branch information...
1 parent d617403 commit f27578d41ca1b01ad0cc8a93a15d3d2daf236132 @herm herm committed Sep 13, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 bindings/python/mapnik/__init__.py
@@ -699,6 +699,18 @@ def make_it(feat, idx):
class _TextSymbolizer(TextSymbolizer,_injector):
@property
+ def name(self):
+ if isinstance(self.properties.format_tree, FormattingText):
+ return self.properties.format_tree.text
+ else:
+ return None # This text symbolizer is using complex formatting features.
+ # There is no single expression which could be returned as name
+
+ @name.setter
+ def name(self, name):
+ self.properties.format_tree = FormattingText(name)
+
+ @property
def text_size(self):
warnings.warn("'text_size' is deprecated, use format.text_size",
DeprecationWarning, 2)

0 comments on commit f27578d

Please sign in to comment.