[Mapserver-users] addColor error in PHP/MapScript
Rene Teniere
TENIERER at gov.ns.ca
Thu Feb 12 09:23:38 PST 2004
--=__Part3F1E598A.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Hello all,
I keep getting the error: Call to undefined function: addcolor() in my
PHP error_log. I thought I had it set up correctly. Does anyone have any
suggestions?
Hope someone can help.
Rene
<?php
$map_path = "C:/chameleon11a/websites/wap/";
$map = ms_newMapObj($map_path."sketch.map");
$map->setExtent($minX-10, $minY-10, $maxX+10, $maxY+10);
//Set colours
$cWhite = $map->addColor(255,255,255);
$cBlack = $map->addColor(0,0,0);
$wap_all = ms_newLayerObj($map);
$wap_all->set("name", "wap_parcels");
$wap_all->set("type", MS_LAYER_POLYGON);
$wap_all->set("status", MS_ON);
$wap_all->set("data", "wap_all.shp");
$wap_all->set("maxscale", 500000);
$wap_all->set("labelitem", "id");
$wap_all->set("labelmaxscale", 100000);
$wap_class = ms_newClassObj($wap_all);
$wap_class->set("status", MS_ON);
$wap_class->set("color", $cWhite);
$wap_class->set("outlinecolor", $cBlack);
$wap_class->set("symbol", 0);
$wap_class->set("size", 1);
$wap_class->set("minsize", 0);
$wap_class->set("maxsize", 100);
$wap_label = $wap_class->label;
$wap_label->set("type", MS_BITMAP);
$wap_label->set("size", MS_MEDIUM);
$wap_label->set("position", MS_CC);
$wap_label->set("color", $cBlack);
$image = $map->draw();
$scalebar = $map->drawScaleBar();
$image_url = $image->saveWebImage();
$scalebar_url = $scalebar->saveWebImage();
?>
MAP
NAME "Hurricane Juan Page"
STATUS ON
EXTENT 381053 4915490 573294 5059550
SIZE 950 600
SHAPEPATH "D:/gis_data/wap_2002/"
SYMBOLSET "C:/chameleon11a/etc/symbols.sym"
FONTSET "C:/chameleon11a/etc/fonts.txt"
IMAGETYPE PNG24
IMAGECOLOR 255 255 255
UNITS METERS
RESOLUTION 90.714286
WEB
IMAGEPATH "c:/temp/tmp/"
IMAGEURL "/temp/tmp/"
END
QUERYMAP
STATUS ON
SIZE -1 -1
COLOR 255 255 0
STYLE HILITE
END
PROJECTION
"init=epsg:2038"
#UTM Zone 20 NAD83 for Nova Scotia
END
SCALEBAR
STATUS ON
COLOR 255 255 255
OUTLINECOLOR 0 0 0
BACKGROUNDCOLOR 0 0 0
IMAGECOLOR 255 255 255
UNITS METERS
INTERVALS 5
SIZE 250 5
STYLE 0
POSITION LL
LABEL
TYPE BITMAP
SIZE SMALL
OFFSET 0 0
BUFFER 0
MINDISTANCE -1
MINFEATURESIZE -1
COLOR 0 0 0
PARTIALS TRUE
FORCE FALSE
END
END
OUTPUTFORMAT
NAME "PNG24"
MIMETYPE "image/png"
DRIVER "GD/PNG"
EXTENSION "png"
IMAGEMODE RGB
END
LAYER
NAME "Roads"
GROUP "Base Data"
STATUS ON
TYPE LINE
MAXSCALE 500000
TILEINDEX "D:/GIS_Data/coindex/coindex"
TILEITEM "lonetlin"
CLASSITEM "fcode"
CLASS
STYLE
SYMBOL 0
COLOR 255 0 0
SIZE 1
MINSIZE 1
MAXSIZE 100
END
END
END
LAYER
NAME "NS Shoreline"
GROUP "Base Data"
STATUS ON
DATA "D:/GIS_Data/shoreutm/shoreutm"
TYPE LINE
CLASS
STYLE
SYMBOL 0
COLOR 72 164 255
SIZE 2
MINSIZE 1
MAXSIZE 100
END
END
END
END
--=__Part3F1E598A.0__=
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hello all,</DIV>
<DIV>I keep getting the error: Call to undefined function: addcolor() in my PHP error_log. I thought I had it set up correctly. Does anyone have any suggestions?</DIV>
<DIV> </DIV>
<DIV>Hope someone can help.</DIV>
<DIV>Rene</DIV>
<DIV> </DIV>
<DIV> <?php<BR> $map_path = "C:/chameleon11a/websites/wap/";<BR> $map = ms_newMapObj($map_path."sketch.map");<BR> $map->setExtent($minX-10, $minY-10, $maxX+10, $maxY+10);</DIV>
<DIV> </DIV>
<DIV> //Set colours<BR> $cWhite = $map->addColor(255,255,255);<BR> $cBlack = $map->addColor(0,0,0);</DIV>
<DIV> </DIV>
<DIV> $wap_all = ms_newLayerObj($map);<BR> $wap_all->set("name", "wap_parcels");<BR> $wap_all->set("type", MS_LAYER_POLYGON);<BR> $wap_all->set("status", MS_ON);<BR> $wap_all->set("data", "wap_all.shp");<BR> $wap_all->set("maxscale", 500000);<BR> $wap_all->set("labelitem", "id");<BR> $wap_all->set("labelmaxscale", 100000);</DIV>
<DIV> </DIV>
<DIV> $wap_class = ms_newClassObj($wap_all);<BR> $wap_class->set("status", MS_ON);<BR> $wap_class->set("color", $cWhite);<BR> $wap_class->set("outlinecolor", $cBlack);<BR> $wap_class->set("symbol", 0);<BR> $wap_class->set("size", 1);<BR> $wap_class->set("minsize", 0);<BR> $wap_class->set("maxsize", 100);</DIV>
<DIV> </DIV>
<DIV> $wap_label = $wap_class->label;<BR> $wap_label->set("type", MS_BITMAP);<BR> $wap_label->set("size", MS_MEDIUM);<BR> $wap_label->set("position", MS_CC);<BR> $wap_label->set("color", $cBlack);</DIV>
<DIV> </DIV>
<DIV> $image = $map->draw();<BR> $scalebar = $map->drawScaleBar();<BR> $image_url = $image->saveWebImage();<BR> $scalebar_url = $scalebar->saveWebImage();<BR> ?></DIV>
<DIV>MAP<BR> NAME "Hurricane Juan Page"<BR> STATUS ON<BR> EXTENT 381053 4915490 573294 5059550 <BR> SIZE 950 600<BR> <BR> SHAPEPATH "D:/gis_data/wap_2002/"<BR> SYMBOLSET "C:/chameleon11a/etc/symbols.sym"<BR> FONTSET "C:/chameleon11a/etc/fonts.txt"<BR> IMAGETYPE PNG24<BR> IMAGECOLOR 255 255 255<BR> UNITS METERS<BR> RESOLUTION 90.714286<BR> WEB<BR> IMAGEPATH "c:/temp/tmp/"<BR> IMAGEURL "/temp/tmp/"<BR> END<BR> QUERYMAP<BR> STATUS ON<BR> SIZE -1 -1 <BR> COLOR 255 255 0<BR> STYLE HILITE<BR> END<BR> PROJECTION<BR> "init=epsg:2038" <BR> #UTM Zone 20 NAD83 for Nova Scotia<BR> END<BR> SCALEBAR<BR> STATUS ON<BR> COLOR 255 255 255<BR> OUTLINECOLOR 0 0 0<BR> BACKGROUNDCOLOR 0 0 0<BR> IMAGECOLOR 255 255 255<BR> UNITS METERS<BR> INTERVALS 5<BR> SIZE 250 5 <BR> STYLE 0<BR> POSITION LL<BR> LABEL<BR> TYPE BITMAP<BR> SIZE SMALL<BR> OFFSET 0 0 <BR> BUFFER 0<BR> MINDISTANCE -1<BR> MINFEATURESIZE -1<BR> COLOR 0 0 0<BR> PARTIALS TRUE<BR> FORCE FALSE<BR> END<BR> END<BR> OUTPUTFORMAT<BR> NAME "PNG24"<BR> MIMETYPE "image/png"<BR> DRIVER "GD/PNG"<BR> EXTENSION "png"<BR> IMAGEMODE RGB<BR> END<BR> LAYER<BR> NAME "Roads"<BR> GROUP "Base Data"<BR>
STATUS ON<BR> TYPE LINE<BR> MAXSCALE 500000<BR> TILEINDEX "D:/GIS_Data/coindex/coindex"<BR> TILEITEM "lonetlin"<BR> CLASSITEM "fcode"<BR> CLASS<BR> STYLE<BR> SYMBOL 0<BR> COLOR 255 0 0<BR> SIZE 1<BR> MINSIZE 1<BR> MAXSIZE 100<BR> END<BR> END<BR> END<BR> LAYER<BR> NAME "NS Shoreline"<BR> GROUP "Base Data"<BR> STATUS ON<BR> DATA "D:/GIS_Data/shoreutm/shoreutm"<BR> TYPE LINE<BR> CLASS<BR> STYLE<BR> SYMBOL 0<BR> COLOR 72 164 255<BR> SIZE 2<BR> MINSIZE 1<BR> MAXSIZE 100<BR> END<BR> END<BR> END<BR>END<BR></DIV></BODY></HTML>
--=__Part3F1E598A.0__=--
More information about the MapServer-users
mailing list