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

Frieso ter Haseborg ter-haseborg at sf-datentechnik.de
Tue Sep 30 07:43:15 EDT 2003


Hi Vinko,

>>Sounds good to me, but why can I change the symbol on using only ONE
>>class?
>I don't know. I've never done it that way, maybe it's a useful bug :-)

Okay but only useful when there's no need to colorize the different
symbols. ;-)
Let's leave it at that.

>>// transfer label-information THIS FAILES!
>>$newclass->label=$originalclass->label;     
>I'd do this $newclass->label->set("font",$originalclass->label->font),
>etc.

YES! Success at last. *bg* Thank you very much! 

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.

>> Yes a example would be a great help!
>$add = $this->figures->getByType('polygon');
>for ($i=0;$i<count($poly);$i++) {
>	$line = ms_newLineObj();
>	while ($pt = $poly[$i]->getPoint()) {
>		$line->addXY($pt['x'],$pt['y'],0);
>	}
>	$shp = ms_newShapeObj(MS_SHAPE_POLYGON);
>	$shp->add($line);
>	$shp->set('text',$poly[$i]->getId());
>	$shp->set("classindex",0);
>	$lyr->layer->addFeature($shp);
>}

But this way doesn't spare handling with one individual class per
symbol, does it? I think I missed the advantage.

TIA,
 
Frieso ter Haseborg
- Software Development - 
 
--

-------------------------------------------------- 
S&F Datentechnik GmbH&Co.KG 
Reimersstr. 41b 
26789 Leer, Germany







More information about the mapserver-users mailing list