[Mapserver-users] Get the color of a class

Sean Gillies sgillies at frii.com
Wed Mar 17 09:41:41 EST 2004


On Mar 17, 2004, at 2:10 AM, Irene Pérez wrote:

> I need get the color of a layer, and I've:
>
> $Class1 = $miLayer->GetClass(0);
> echo "Class: ".$Class1-> name;
> echo "Class: ".$Class1-> template;
> and I obtain the name, the template ...
> ....
> but i need the color:
>
> echo "Class: ".$Class1->outlinecolor;
> echo "Class: ".$Class1->color;
> appears in blank.
>
> Thanks.
>

I'm guessing here, but you are using mapserver 4?

In version 4, colors are now defined in the styles attribute of
a class.

$Class1->{styles}->{outlinecolor};

cheers,
Sean

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




More information about the mapserver-users mailing list