[Mapserver-users] legendObj outlinecolor property does not exist?

Daniel Morissette morissette@dmsolutions.ca
Mon, 26 May 2003 19:43:26 -0400


Ooopps, you're talking about the legendObj, not the classObj... I should
have read your message more closely before responding... duh!

This change should also be described in the migration guide, but it's a
different story: the legend->outlinecolor is now of type ColorObj like
all other color variables in mapscript, so you access it this way:

   $my_legend->outlinecolor->setRGB(255,0,0);

Daniel


Daniel Morissette wrote:
> 
> The class outlinecolor has been moved to a new style object in version
> 4.0dev.  You can get the latest PHP MapScript 4.0 (a.k.a. 3.7) docs at:
> http://www2.dmsolutions.ca/mapserver/dl/mapserver-3.7-dev-PHP-MAPSCRIPT-README.txt
> 
> See also the migration guide in the wiki for a more complete list of
> changes between 3.6 and 4.0:
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MigrationGuide
> 
> Daniel
> 
> Gerald Buckmaster wrote:
> >
> > Greetings,
> >
> > In the process of learning how to code PHP/Mapscript applications, I ran
> > across a possible removal of a property from the legendObj class.  My Linux
> > system consists of 2.4.21-0.13mdk, PHP Version 4.3.2RC3, and MapServer
> > version 4.0 (development) OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ
> > SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=TIFF INPUT=EPPL7 INPUT=JPEG
> > INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE.
> >
> > When the code (offending portion remarked out) below is executed, nothing is
> > displayed and I get the following error in my Apache error_log: PHP Fatal
> > error:  Property 'outlinecolor' does not exist in legend object.
> >
> >         $my_legend = $map->legend;
> >         $my_legend->set(height, 80);
> >         $my_legend->set(width, 160);
> >         #$my_legend->set(outlinecolor, 1);
> >         $my_legend->set(status, MS_EMBED);
> >         $my_legend->set(position, MS_UL);
> >         $my_legend->set(postlabelcache, MS_TRUE);
> >         $map->drawLegend();
> >
> > BTW, when the offending line (concerning outlinecolor) is remarked out, the
> > applications works perfectly.
> >
> > According to DM Solutions documentation on Mapscript 3.6, located at:
> > http://www2.dmsolutions.ca/webtools/php_mapscript/php_mapscript_docs36.html
> >
> > The property does exist as shown below:
> >
> > legendObj Class
> >  -----------
> >
> >  Constructor:
> >
> >    Instances of legendObj are always are always embedded inside the mapObj.
> >
> >  Members:
> >
> >    int height;
> >    int width;
> >    int keysizex;
> >    int keysizey;
> >    int keyspacingx;
> >    int keyspacingy;
> >    int outlinecolor; //Color of outline of box, -1 for no outline
> >    int status; //MS_ON, MS_OFF, MS_EMBED
> >    int position; //for embeded legends, MS_UL, MS_UC, ...
> >    int transparent;
> >    int interlace;
> >    int postlabelcache; //MS_TRUE, MS_FALSE
> >    labelObj label;
> >    colorObj imagecolor;
> >    string   template
> >
> > Did this property get dropped in the recent development, or did I miss
> > something in the build of of Mapserver 4.0 dev?  More importantly, can I
> > duplicate the functionality of the outlinecolor property of legendObj with
> > other code?
> >
> > Thanks,
> >
> > Gerald
> >
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users