problems with ms_newClassObj
Dieter Lehmann
lehmann at fh-nuertingen.de
Mon Jan 15 23:40:02 PST 2001
Hi Daniel,
thanks a lot, I got the nightly built and compiled them - now it is working.
I was using the 3.3.011 -Version (that is the most recent one on the web-site
instead of the nightly built ones.)
Thanks for the tip with the colors!
Dieter
> Dieter Lehmann wrote:
> >
> > Hi there,
> > I get stuck using mapscript/php3. With my attached code I get an "document
> > contains no data".
> > Think, something is wrong with the Class-definition.
> > (using only the map-file without the definitions of a class everything is o.k.).
> >
>
> Dieter,
>
> I tried your script and .map file using PHP3 and recent versions (about
> 1 week old) of MapScript on Linux and Win98, and in both cases it passes
> the classes part, but returns the following error:
>
> Fatal error: MapServer Error in msDrawMap(): Image dimensions not
> specified. in ex1.phtml on line 16
>
> ... that's because your .map file is missing important parameters like
> EEXTENTS, SIZE, and a WEB object.
>
> However, I don't think that explains your crash... because "Document
> contains no data..." means that the server crashed without generating
> any output. How old is your PHP/MapScript DLL (or .so) ? It might be a
> good idea to get a more recent one... either compiling the latest
> nightly build on Unix, or if you're on Windows there is a recent
> precompiled PHP3_MAPSCRIPT.DLL that you can download at
> http://www2.dmsolutions.ca/mapserver/dl/ms_3.4pr-win32-ogr-php3-20010103.zip
>
> BTW, setting colors the way you did in the classes would not give the
> expected results... the color parameter in a class object in a .map file
> is the RGB value, but in MapScript it is a color index obtained from
> addColor(). So the following lines in your script:
>
> > $poClass->set("color",255, 0, 0);
> > $poClass->set("outlinecolor",255,0,0);
> >
>
> Should be replaced with:
>
> $poClass->set("color", $map->addColor(255, 0, 0) );
> $poClass->set("outlinecolor", $map->addColor(255, 0, 0) );
>
> Good Luck!
> --
> ------------------------------------------------------------
> Daniel Morissette morissette at dmsolutions.ca
> http://www.dmsolutions.ca/
> ------------------------------------------------------------
> Don't put for tomorrow what you can do today, because if
> you enjoy it today you can do it again tomorrow.
--
___________________________________
Dieter Lehmann
University of applied Sciences
Schelmenwasen 4-8
D-72622 Nuertingen, Germany
lehmann at fh-nuertingen.de
Phone: +49 (0) 7022 404 Ext. 192 or Ext. 152
Fax: +49 (0) 7022 404 Ext. 166
More information about the MapServer-users
mailing list