[Mapserver-users] Re: Clarifications about mapscript 4.2

Eric Bridger eric at gomoos.org
Thu May 13 09:09:20 EDT 2004


On Wed, 2004-05-12 at 17:13, Sean Gillies wrote:
> Hey Eric,
> 
> I'm unable to reproduce your problems with my Python interpreter.  Here
> is a session below.  Note that I'm using the next generation class
> names ... 'Map' is exactly the same as 'mapObj', 'Color' == 'colorObj',
> &c.
> 
>      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('/home/sean/projects/ms_42/mapserver/tests/test.map')
>      >>> class00 = test_map.getLayer(0).getClass(0)
>      >>> s0 = class00.getStyle(0)
>      >>> s0
>      <C styleObj instance at _b0761808_p_styleObj>
>      >>> s0.color.toHex()
>      '#ff9966'
>      >>> s0.color.setRGB(0,0,0)
>      0
>      >>> s0.color.toHex()
>      '#000000'
>      >>> s0.color.setRGB(51,51,51)
>      0
>      >>> s0.color.toHex()
>      '#333333'
>      >>> s0.color.setRGB(102,102,102)
>      0
>      >>> s0.color.toHex()
>      '#666666'
> 
> I can't reproduce the sticking.  Next a test with defined colors.
> 
>      >>> blue = mapscript.Color(0,0,255)
>      >>> blue.toHex()
>      '#0000ff'
>      >>> s0.color = blue
>      >>> s0.color.toHex()
>      '#0000ff'
>      >>> red = mapscript.Color(255,0,0)
>      >>> s0.color = red
>      >>> s0.color.toHex()
>      '#ff0000'
>      >>> s0.color = blue
>      >>> s0.color.toHex()
>      '#0000ff'
> 
> So it appears that this is working OK as well.
> 
> Now, looking at your script, there is a line
> 
> 	$point->draw($map, $layerObj, $img, undef, "$point_id");
> 
Sean,

Perl mapscript4.2b2 works in the above cases as well.  The problem seems
to lie deeper, in the point->draw() method, i.e. even when
style->toHex() reports #0000ff, point->draw() draws a black or whatever
color was first set.  I will continue to investigate.

Eric





More information about the mapserver-users mailing list