[Mapserver-users] can I use different symbols in thesamedynamiclayer?

Frieso ter Haseborg ter-haseborg at sf-datentechnik.de
Tue Sep 30 09:14:08 EDT 2003


Hi Daniel,

thanx a lot, that gives a lot more clarification.

So my try to demonstrate that $class->color is obsolete with this
script:
$class->color->red = 0;
$class->color->green = 255;
$class->color->blue = 0;
was not sooo clever. ;-)

@Eric:
>Frieso, as a work around have you tried using the old $class->{color}
>member?   The old CLASS members seem to still exist in 4.0.
The answer remains: $class->color is obsolete, but I think the correct
proof has to look like this:
$color=$class->color;
$color->setRGB ( 0, 255, 0 );	// this raises: "Fatal error: Call to a
member function on a non-object in ..."
$class->color=$color;

Best regards,
Frieso


>-----Original Message-----
>From: Daniel Morissette [mailto:morissette at dmsolutions.ca]
>Sent: Tuesday, September 30, 2003 2:37 PM
>To: Frieso ter Haseborg
>Cc: mapserver-users at lists.gis.umn.edu; eric at gomoos.org
>Subject: Re: [Mapserver-users] can I use different symbols in
>thesamedynamiclayer?
>
>
>Frieso ter Haseborg wrote:
>> 
>> Even if this gets slowly off topic - if you will excuse me - what's
>> wrong with $newclass->label=$originalclass->label;
>> 
>> I must have a wrong understanding of the class-handling in
>> PHP/MapScript. I thought I could transfer the whole 
>sub-class (member)
>> e.g. the label with all it's attributes set to another 
>class. At least
>> when I use a class in a class with pure PHP such operations are no
>> problems, the sub-class with all it's attributes is given to the new
>> class.
>> 
>
>You can't do this with PHP MapScript.  The reason is that the 
>MapScript 
>classes are not pure PHP classes, they are just wrappers on top of the 
>low-level C structures.  When you assign label objects this way, only 
>the PHP wrapper part of the object is copied, but the low-level C 
>structure is not modified.  That's the same reason why you need to use 
>the set() methods to set class member variables and cannot set them 
>directly.
>
>-- 
>------------------------------------------------------------
>  Daniel Morissette               morissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
>------------------------------------------------------------
>
>
>




More information about the mapserver-users mailing list