[Mapserver-users] problem with Layer on-fly with MapServer 4
collao_andres
collao_andres at hotmail.com
Sat Dec 6 04:35:59 PST 2003
hi, i have the following code in PHP/MapScript
dl('php_mapscript.so');
// Default values and configuration
$gpoMap_path="/usr/local/apache2/htdocs/test/data/";
$gpoMap = ms_newMapObj($gpoMap_path."base.map");
$layer_tmp=ms_newLayerObj($gpoMap);
$layer_tmp->set('name','cuencas');
$layer_tmp->set('status',MS_On);
$layer_tmp->set('data',"the_geom from cuencas");
$layer_tmp->set('connectiontype',POSTGIS);
$layer_tmp->set('connection', "user=postgres password=postgres
dbname=cnr host=localhost port=5432");
$layer_tmp->set('type',MS_LAYER_POLYGON);
// 0 = punto 1= linea 2 = poligono
//crea una CLASE apra LAYER anterior
$clase_tmp=ms_newClassObj($layer_tmp);
$clase_tmp->set("status",1);
$estilo=ms_newStyleObj($clase_tmp);
$estilo->color->setRGB(0,0,0);
$estilo->outlinecolor->setRGB(255,0,0);
$imagen=$gpoMap->draw();
$imagen_url=$imagen->saveWebImage();
$arreglo= $gpoMap->getAllLayerNames();
Lamentably this new one layer with name "cuencas" does not show, when
I review it the layers by means of the variable $arreglo appears,
thus technically is in the map, but it continues being thus
transparatente or something.
Somebody has some idea?
thanks
More information about the MapServer-users
mailing list