[Mapserver-users] [Fwd: [maplab-users] class and style changes in Mapscript 37]

Dave McIlhagga mcilhagga@dmsolutions.ca
Tue, 15 Apr 2003 08:39:06 -0400


This is better directed to the MapServer mailing list.

-------- Original Message --------
Subject: [maplab-users] class and style changes in Mapscript 37
Date: Mon, 14 Apr 2003 11:07:19 -0400
From: "Lochner,Chris [NCR]" <Chris.Lochner@ec.gc.ca>
To: "'maplab-users@dmsolutions.ca'" <maplab-users@dmsolutions.ca>



Hi Folks,

I've been having great difficulty using the new style functions in
Mapscript 37.

I'm trying to extract a class object from the mapfile and change the
symbol size and color in php.

I have tried various adaptations of the mapscript 36 method but they are
quite dissimilar due to the new "style-type" instructions that 37 uses.
I've been working off the manual that Danielle (Morrisette) wrote for 37.

Here is part of the code, there are lots of different ideas in here from
other versions of mapscript but none of them seem to work,

                         $class = ms_newClassObj($layer);
                         //$class = $layer->getClass(0);
                         //printf("classname = %s",$class->name);
                         //printf("symbol under class =
%s",$class->get("symbol"));
                         //$class->set("symbol", "square");
                         $style = ms_newStyleObj($class);
                         $style->color->setRGB($rgb[r], $rgb[g], $rgb[b]);
                 //$class->set("color", $colorId);
                         $style->size = 1;
                         $style->symbol = 6;
                         //$class->set("size", 4);
             if ($HTTP_FORM_VARS["CURRENT_PROG_ID"] == $ProgramIds[$iRow]||
                 ($HTTP_FORM_VARS["CURRENT_PROG_ID"] <= 0 &&
                 $HTTP_FORM_VARS["CURRENT_PROG_ID2"] == $ProgramIds[$iRow]))
             {
                                 $style->symbol = 2;
                                 $style->size = 1;
                 //$class->set("size", 8);
             }
             else if ($ProgramCategory[$iRow] == 2) {
               $style->symbol = 4;
                           //$class->set("symbol", 4);
                         }
             else {
                                 $style->symbolname = "star";
                //$class->set("symbol", 3);
                         }
             $style->outlinecolor->setRGB(0, 0, 0);

Am I on the right track with any of these? Any tips would be appreciated.

Cheers,
Chris Lochner
Lochner inc,
(Environment Canada - Water Quality Branch)


_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users