On 3/10/2010 3:53 PM, Carlos Ruiz wrote:
Hi all,

I noticed something odd when I do a query with the new 5.6.1 version.

The getFeature method seems to return a NULL value, when it was working
good before the new version update.

Here's the code:

$n = $map->numlayers;

for ($i = 0; $i < $n; $i++) {

$theme = $map->GetLayer($i);

if ($tema->isVisible()) {
--------^
theme?


if (($regs = $theme->getNumResults()) == 0) {
continue;
}
}
else {
continue;
}

$theme->open();
$values = $theme->getitems();

unset($atts);

for ($reg = 0; $reg < $regs; $reg++) {

$result = $theme->getResult($reg);
// getFeature is returning NULL with the 5.6.1 version
$element = $theme->getFeature($result->shapeindex, $result->tileindex);

for ($value = 0; $value < count($values); $value++) {
$atts[] = $values[$value] . " " . $element->values[$values[$value]];
}

// php crash because $element is a non object
$element->free();

}

$theme->close();

...

}

Any help or idea will be appreciated.

Thanks in advance

IC Carlos Ruiz



_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to