[Mapserver-users] Re: Clarifications about mapscript 4.2
Sean Gillies
sgillies at frii.com
Thu May 13 07:04:52 PDT 2004
On May 13, 2004, at 7:09 AM, Eric Bridger wrote:
> 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
>
Yes, I think the problem is in your call to $point->draw(). You should
be passing an integer class index as the 4th argument, not an undef.
You clipped this from my previous email, so I wonder if you read it?
Sean
--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies
More information about the MapServer-users
mailing list