[mapserver-users] the infamous 'invalid _map_handle_' strikes again

Vinko Vrsalovic B. v at w.cl
Wed Aug 8 11:26:06 PDT 2001


Well, I finally got the time to upgrade from PHP4.0.3 to PHP 4.0.6.

I'm using the latest CVS build of MS3.5 (08-01) and when executing this code:

dl("php_mapscript.so");

$map = ms_newMapObj("../buses.map");

$imag = $map->prepareImage();

$l_stgo=$map->getLayerByName("arcosbase");
$l_stgo->set("status",1);

$l_stgo->draw($imag);

$bar = $map->drawScalebar();
$url_bar = $bar->saveWebImage(MS_PNG,0,0,0);
$map->drawLabelCache($imag);
$url = $imag->saveWebImage(MS_PNG, 0,0,0);

I get a:

Fatal error: Object has an invalid '_map_handle_' property in /var/www/html/ms_demo/php/layer.php on line 11

If I change the $l_stgo->draw($imag); line to $imag=$map->draw(); 
it works perfectly.

-- 
V. <v at w.cl>



More information about the MapServer-users mailing list