[mapserver-users] Changing IMAGECOLOR with PHP MapScript

Jeff McKenna mckenna at dmsolutions.ca
Thu Sep 27 16:33:11 EDT 2001


"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


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/



More information about the mapserver-users mailing list