Ticket #663 (closed defect: fixed)
pointObj::draw doesn't respect dynamically set style color
| Reported by: | sgillies@… | Owned by: | sgillies@… |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | MapScript | Version: | 4.2 |
| Severity: | critical | Keywords: | |
| Cc: | eric@… |
Description
Programming the color of a class style has no effect on the
output of pointObj::draw. Here's an example
Python 2.3.3 (#1, Jan 4 2004, 11:27:28)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapscript
>>> test_map = mapscript.Map('../../tests/test.map')
>>> img = test_map.draw()
The above draws a map, including a single inline point.
Below we are going to dynamically draw a point according
to the layer named INLINE, and will change the first
style's foreground color from black to red.
>>> inline = test_map.getLayerByName('INLINE')
>>> inline.getClass(0).getStyle(0).color.setRGB(255,0,0)
0
>>> inline.getClass(0).getStyle(0).color.toHex()
'#ff0000'
>>> p = mapscript.Point(0.2,51.5)
>>> p.draw(test_map, inline, img, 0, "foo")
0
>>> img.save('test_new_point.png')
Draws a new black point when we expect red. Will attach the file.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

