Having hard time adding layers with php

Berend Veldkamp b.veldkamp at zonnet.nl
Tue Nov 14 10:38:36 EST 2000


Hi all,
I have the feeling I'm missing something obvious. What I want to do is
add certain layers from my mapfile, in PHP. This is what I have come up
with, so far:

$map = ms_newMapObj ("wm12.map");
$img = $map->draw();
$layer = $map->getLayerByName ("roads");
// printf ("%s\n", $layer->name); // It's there
$layer->draw ($img);

But PHP stops while doing this last statement, without giving any error
messages.
I have also tried setting $layer->status to MS_ON before calling
$map->draw(), this doesn't work either:

$map = ms_newMapObj ("wm12.map");
$layer = $map->getLayerByName ("roads");
$layer->status = MS_ON;  // Now it's ON

// Testing purpose:
// $layer = $map->getLayerByName ("roads");
// printf ("%d\n", $layer->status); // Now it's OFF again

$img = $map->draw();

Can anyone shed some light on this, I have a nightly build from a week
ago and PHP 4.0.3pl1

Berend


--
_________________________________________________

ARIS - Hooghiemstraplein 126 - NL 3514 AZ Utrecht
tel. +31 30 2769180    -    fax. +31 30 2733578
URL: http://www.aris.nl/
_________________________________________________






More information about the mapserver-users mailing list