[Mapserver-users] can I use different symbols in the samedynamic layer?
Eric Bridger
eric at gomoos.org
Wed Sep 24 03:01:42 PDT 2003
You're right Frieso,
I am still using 3.6
The issue you mention below exists in 3.6 as well. What you need to do
is to get a new class for each point and set the color and symbol anew.
On Wed, 2003-09-24 at 09:27, Frieso ter Haseborg wrote:
> Hi,
>
> one more question: Can't I change the color the same way? After
> successfully using different symbols, I tried to change the color of the
> symbols also. But a color-change only takes effect for the first change
> resp. for the first symbol drawn. All subsequent symbols are drawn in
> _this_ new color also, but not in the individual color specified for
> each symbol.
>
> My PHP/MapScript goes like this:
> $sym1 = $map->getSymbolByName ( "excl" );
> $sym2 = $map->getSymbolByName ( "tent" );
> $class = $layer->getClass (0);
> $style = $class->getStyle(0);
>
> // first point
> $style->color->setRGB(0, 0, 255); // now the next point will change to
> blue
> // (symbols in mapfile are
> initialized in red)
> // THIS CHANGE WORKS!
> $style->set ( 'symbol', $sym1 );
> $pt = ms_newPointObj();
> $pt->setXY( 2100000, 10100000 );
> $pt->draw($map, $layer, $image, 0, "Pt1");
>
> // second point
> $style->color->setRGB(0, 255, 0); // now the next point IMO should
> become green, but it doesn't, it stays blue
> // THIS CHANGE FAILES!
> $style->set ( 'symbol', $sym2 );
> $pt = ms_newPointObj();
> $pt->setXY( 4400000, 10000000 );
> $pt->draw($map, $layer, $image, 0, "Pt2");
>
>
> Am I overlooking something or is there any restriction I ran into?
>
> TIA,
>
> Frieso ter Haseborg
> - Software Development -
>
> --
>
> --------------------------------------------------
> S&F Datentechnik GmbH&Co.KG
> Reimersstr. 41b
> 26789 Leer, Germany
>
>
>
> >-----Original Message-----
> >From: Frieso ter Haseborg
> >Sent: Wednesday, September 24, 2003 9:52 AM
> >To: Eric Bridger
> >Cc: mapserver-users at lists.gis.umn.edu
> >Subject: RE: [Mapserver-users] can I use different symbols in the
> >samedynamic layer?
> >
> >
> >Hi Eric,
> >
> >thanx, yes this helped a lot. It works - but so far only, when
> >using the StyleObj-Class.
> >
> >I did the following in PHP:
> >
> >$sym1 = $map->getSymbolByName ( "excl" );
> >$sym2 = $map->getSymbolByName ( "tent" );
> >$class = $layer->getClass (0);
> >$style = $class->getStyle(0);
> >
> >$style->set ( 'symbol', $sym1 );
> >[...]//draw point1
> >
> >$style->set ( 'symbol', $sym2 );
> >[...]//draw point2
> >
> >It looks like the symbol attribute is obsolete in MS and
> >PHP/MapScript version 4.0, though no error is raised. It
> >simply effects nothing in my configuration. Which version do you use?
> >
> >Anyway it works, thanx again!
> >
> >Best regards,
> >
> >Frieso ter Haseborg
> >- Software Development -
> >
> >--
> >
> >--------------------------------------------------
> >S&F Datentechnik GmbH&Co.KG
> >Reimersstr. 41b
> >26789 Leer, Germany
> >
> >
> >
> >
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list