[mapserver] Java VM Crashes using the Mapscript API

Sean Gillies sgillies at FRII.COM
Thu Jul 28 14:02:06 PDT 2005


On Jul 28, 2005, at 2:43 PM, Rick Innis wrote:

> On Jul 28, 2005, at 16:15, Sean Gillies wrote:
>
>>  All the MapServer classes exist primarily to support the CGI
>> mapserv program, and therefore are complete. An new instance of
>> classObj, for example, already contains a labelObj attribute named
>> "label". To set a class's label color, you should do this
>>
>>     class.label.color.setRGB(red, green, blue)
>>
>
> So to get rid of the black background, would it be legitimate to do
> this?
>
>      class.getLabel().getBackgroundcolor().setRGB(-1, -1, -1);
>      class.getLabel().getBackgroundshadowcolor().setRGB(-1, -1, -1);
>
>      --Rick.
>
>

Rick,

I don't think that is necessary for a classObj's natural label member. 
Try this

     classObj co =  new classObj(null);
     co.getLabel().getBackgroundcolor().getRed()  .... should be -1

On the other hand, if you do this

     labelObj lo = new labelObj();
     lo.getBackgroundcolor().getRed() .... will be 0

The second example is improper usage, the label's colors never get 
properly initialized in this case. Users ought to be better protected 
from these sharp edges of mapscript, but alas.

Sean

--
Sean Gillies
sgillies at frii dot com
http://zcologia.com



More information about the MapServer-users mailing list