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

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


Hi,

>BTW, it is ok to reuse and modify the same class multiple times as long

>as you TURN OFF the label cache.  
This seems not to work in relation to the color-properties. Also with
labelcache turned off I still need multiple classes if I want to use
different colors on my symbols:

I'm doing this:
$class = $layer->getClass(0);
$style = $class->getStyle(0);
$style->color->setRGB(0, 0, 255);	//draw a blue point
$style->set ( 'symbol', $sym1 );
$pt->setXY( 2100000, 10100000 );
$pt->draw($map, $layer, $image, 0, "Pt1");
$map->save('test.map');

$class = $layer->getClass (0);      //new class instance
$style = $class->getStyle(0);       //new style instance
$style->color->setRGB(0, 255, 0);   //draw a green one - 
                                    //!this failes, second symbol
becomes blue also!
$style->set ( 'symbol', $sym2 );
$pt->setXY( 4400000, 10000000 );
$pt->draw($map, $layer, $image, 0, "Pt2");
$map->save('test2.map');

I can't see any difference with labelcache off. It only works with
multiple classes as explained by Vinko.

TIA,
 
Frieso ter Haseborg
- Software Development - 
 
--

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



>I didn't follow the beginning of this thread and didn't test this 
>specifically, but my understanding is that the behavior didn't change 
>between 3.6 and 4.0 with respect to this.  i.e. if you have a 3.6
script 
>that was setting classes dynamically then it should continue to work 
>with 4.0 once you adapt it to work with styles.
>
>BTW, it is ok to reuse and modify the same class multiple times as long

>as you TURN OFF the label cache.  If you leave the label cache enabled 
>then you cannot modify a class until the shapes (labels) in the cache 
>that use it have been drawn/flushed from the cache.
>
>-- 
>------------------------------------------------------------
>  Daniel Morissette               morissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
>------------------------------------------------------------




More information about the mapserver-users mailing list