[Mapserver-users] PHPmapscript 4, color
Erich Schroeder
erich at museum.state.il.us
Thu Jul 3 14:11:32 PDT 2003
Hi,
I'm confused in how I should be rewriting some phpmapscript for changing
from version 3.5 to 4.
In my application it looks to see if a polygon shapefile showing modern
distribution of a taxon exists, and if so adds it as a layer. It then
checks to see if the user wanted it to show, and if not turns the layer
off.
The old script looks like:
//Check if modern distribution is present, and add
if (file_exists("mammal/$TaxonLower.shp")) {
$distpresent = TRUE;
$layer = ms_newLayerObj($map);
$layer->set("data","mammal/$TaxonLower");
$layer->set("name","moderndist");
$layer->set("type",MS_LAYER_POLYGON);
$layer->set("status",MS_ON);
if ($drawdist == "n") {$layer->set("status",MS_OFF);}
$distcolor = $map->addColor(232,151,97);
$class = ms_newClassObj($layer);
$class->set("name","ModernDistribution");
$class->set("symbol",0);
$class->set("color",$distcolor);
$ok = $map->moveLayerUp(3);
$ok = $map->moveLayerUp(3);
$img = $map->draw();
} //end of modern dist
And now of course it chokes on the
$distcolor = $map->addColor(232,151,97);
line.
Am I supposed to now have a line like:
$class->setRGB(232,151,97);
Erich
--
---------------------------------------------------------------------
Erich Schroeder Phone: (217)785-0033
Curator, Information Technologies FAX: (217)785-2857
Illinois State Museum GIS Lab email:erich(at)illinois.state.museum
http://illinois.state.museum/
---------------------------------------------------------------------
More information about the MapServer-users
mailing list