[ms4w-users] Php Mapscript Error: getLayerByName failed for
Nicholas Efremov-Kendall
n.e.kendall at gmail.com
Wed May 13 21:20:51 EST 2009
Here's the error generated. I'm trying to customize one of Bill Kropola's
examples to my own data. Any suggestions
*Warning*: getLayerByName failed for : sites in *
C:\ms4w\Apache\htdocs\jerba_dbase\index.php* on line *121*
*Fatal error*: Call to a member function set() on a non-object in *
C:\ms4w\Apache\htdocs\jerba_dbase\index.php* on line *122
if (preg_match("/satt/", $layers)){
$satt = "CHECKED";
$this_layer = $map->getLayerByName('satt');
$this_layer->set('status', MS_ON);
} else {
$satt = "";
$this_layer = $map->getLayerByName('satt');
$this_layer->set('status', MS_OFF);
}
if (preg_match("/soils/", $layers)){
$lakes = "CHECKED";
$this_layer = $map->getLayerByName('soils');
$this_layer->set('status', MS_ON);
} else {
$soils = "";
$this_layer = $map->getLayerByName('soils');
$this_layer->set('status', MS_OFF);
}
if (preg_match("/sites/", $layers)){
$states = "CHECKED";
$this_layer = $map->getLayerByName('sites');
$this_layer->set('status', MS_ON);
} else {
$sites = "";
$this_layer = $map->getLayerByName('sites');
$this_layer->set('status', MS_OFF);
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20090513/e649d55c/attachment.htm
More information about the MS4W-Users
mailing list