[Mapserver-dev] $map->numlayers, $class->numclasses Bug in 4.0 cvs?
Nicol Hermann
nicol at nicol.info
Wed Jul 9 13:27:33 EDT 2003
--=-xn3RsCATl0ukmTHS8nep
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi all,
I'am using the lastest cvs version of Mapserver 4.0 ($Revision: 1.174 $
$Date: 2003/07/08 21:53:12 $) with the code attached.
$map->numlayers as well as $class->numclasses retured Zero although it
exists one layer and one class. The image appears correct. Is this a bug
or did i do something stupid wrong? The same code with mapserver 4.0b
returned the expected values 1 and 1.
Thank you
Nicol
--=-xn3RsCATl0ukmTHS8nep
Content-Disposition: attachment; filename=testrohling.php
Content-Type: application/x-php; name=testrohling.php
Content-Transfer-Encoding: 7bit
<?
dl("../bin/php_mapscript_37.so");
$map = ms_newMapObj('') or die('Unable to open mapfile.');
$map -> web -> set ("imagepath","/home/nicol/public_html/mapserver/tmp/");
$map -> web -> set ("imageurl", "/~nicol/mapserver/tmp/");
$map -> set ("width", 300);
$map -> set ("height", 300);
$map -> selectOutputFormat('PNG');
$map -> setExtent(5.86562681198,47.2757873535,15.0398788452,55.0556488037);
// First Layer
$Layer = ms_newLayerObj($map);
$Layer -> set("name","brd");
$Layer -> set("status", 1);
$Layer -> set("data","/home/nicol/public_html/mapserver/data/brd/brd");
$Layer -> set("type", MS_LAYER_POLYGON );
$poClass = ms_newClassObj($Layer);
$styleObj = ms_newStyleObj($poClass);
$styleObj -> color -> setRGB ( 192, 192, 192 );
$styleObj -> outlinecolor -> setRGB ( 0 , 0, 0);
$poClass -> set("template", "php_selected.html");
$poClass -> set("name", "Deutschland");
$img = $map->draw();
$url = $img->saveWebImage();
$img->free();
printf("<IMG SRC=%s>\n", $url);
printf ('<p>Anzahl der Layer: %s - Anzahl der Klassen im Layer %s: %s', $map->numlayers, $Layer->name, $Layer->numclasses);
?>
--=-xn3RsCATl0ukmTHS8nep--
More information about the mapserver-dev
mailing list