[Mapserver-users] problem with Layer on-fly with MapServer 4

Daniel Morissette morissette at dmsolutions.ca
Sat Dec 6 10:40:06 PST 2003


collao_andres wrote:
> 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);

Constant names are case-sensitive. You should use MS_ON in the line above.

If your layer still doesn't show up after that change then try doing a 
$gpoMap->save("/tmp/test.map") just before your draw() call and then 
check that the layer definition in the saved mapfile looks the way you 
expect.

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               morissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the MapServer-users mailing list