mapnik/mapnik — Issue #947: Fix python bindings and XML output for shield text displacement (dx, dy) in 0.7.x branch
Author: migurski
Created: 2011-11-13 22:29:46+00:00
State: open

Using a recent build of 0.7.x branch, I can't seem to get the "dx" and "dy" properties (listed on the wiki http://trac.mapnik.org/wiki/ShieldSymbolizer) to work in the python bindings or XML output:

```
>>> shield = ShieldSymbolizer('NAME','DejaVu Sans Bold',6,Color('#000000'),'shields/US-US-25.png','png',20,20)
>>> dir(shield)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getinitargs__', '__getstate__', '__hash__', '__init__', '__instance_size__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__safe_for_unpickling__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'allow_overlap', 'anchor', 'avoid_edges', 'character_spacing', 'displacement', 'face_name', 'filename', 'fill', 'fontset', 'force_odd_labels', 'get_anchor', 'get_displacement', 'halo_fill', 'halo_radius', 'horizontal_alignment', 'justify_alignment', 'label_placement', 'label_position_tolerance', 'label_spacing', 'line_spacing', 'max_char_angle_delta', 'minimum_distance', 'name', 'no_text', 'opacity', 'text_convert', 'text_opacity', 'text_ratio', 'text_size', 'unlock_image', 'vertical_alignment', 'wrap_before', 'wrap_character', 'wrap_width']
>>> shield.get_displacement()
[0.0, 0.0]
>>> shield.displacement=(3,3)
>>> shield.get_displacement()
[0.0, 0.0]
>>> shield.displacement
(3, 3)
```