Skip to content
This repository
Browse code

Add TextSymbolizer.name in python bindings.

Refs #1482.
  • Loading branch information...
commit f27578d41ca1b01ad0cc8a93a15d3d2daf236132 1 parent d617403
Hermann Kraus herm authored

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 bindings/python/mapnik/__init__.py
12 bindings/python/mapnik/__init__.py
@@ -699,6 +699,18 @@ def make_it(feat, idx):
699 699
700 700 class _TextSymbolizer(TextSymbolizer,_injector):
701 701 @property
  702 + def name(self):
  703 + if isinstance(self.properties.format_tree, FormattingText):
  704 + return self.properties.format_tree.text
  705 + else:
  706 + return None # This text symbolizer is using complex formatting features.
  707 + # There is no single expression which could be returned as name
  708 +
  709 + @name.setter
  710 + def name(self, name):
  711 + self.properties.format_tree = FormattingText(name)
  712 +
  713 + @property
702 714 def text_size(self):
703 715 warnings.warn("'text_size' is deprecated, use format.text_size",
704 716 DeprecationWarning, 2)

0 comments on commit f27578d

Please sign in to comment.
Something went wrong with that request. Please try again.