[mapserver-users] Changing IMAGECOLOR with PHP MapScript

Hankley, Chip Chip.Hankley at GASAI.Com
Thu Sep 27 14:48:56 PDT 2001


OK,

I tried this
  ($map is passed)
  $bgcolor = $map->addcolor(238,238,238);
  $map->set("imagecolor", $bgcolor);

...and now I get the following error:

Fatal error: Property 'imagecolor' does not exist in this object. in
c:\inetpub\wwwroot\seating\seating.php on line 567

Any ideas?

Chip

I think you have to add a colour first before you try to set its
property (see the MapObject Class and its members in
http://mapserver.gis.umn.edu/doc/phpmapscript-class-guide.html#MapObj),
such as the following:

$color = $map->addcolor(0,0,0);
$map->set("imagecolor", $color);


Jeff

-- 

Jeff McKenna
GIS Specialist
DM Solutions Group Inc.
http://www.dmsolutions.ca/

-----Original Message-----
From: Jeff McKenna [mailto:mckenna at dmsolutions.ca]
Sent: Thursday, September 27, 2001 3:33 PM
To: Hankley, Chip
Cc: Users
Subject: Re: [mapserver-users] Changing IMAGECOLOR with PHP MapScript


"Hankley, Chip" wrote:
> 
> Can someone please show me how to change the background color of my map
with
> PHP MapScript.
> 
> This is the basics of what I've tried so far...
> 
> $map = ms_newMapObj("GB01.map");
> 
> $map->set("imagecolor", 0 0 0);
>  -or-
> $map->set("imagecolor", setRGB(0, 0, 0));
> 
> ...neither seem to be working.
> 
> TIA
> 
> Chip Hankley



More information about the MapServer-users mailing list