mapscript setExpression problems

Robert Chavez rchavez at perseus.tufts.edu
Fri Oct 20 07:57:54 PDT 2000


Howdy folks,

I'm having some trouble changing an expression in a layer using
setExpression.  All this should do is highlight the polygon whose NAME
attribute matches "Bankside Gallery" but when the map draws I get a blank
layer, no highlighting.

Spelling and capitalization are correct and the original expression in the
layer renders correctly, so I must be doing something wrong with
setExpression.  Can anyone shed a little light?  I'm using version
3.3.011.

Here's my snippet of code:

$layer = $map->getLayerByName(leis);
$class = $layer->getClass(0);
$class->setExpression("\"Bankside Gallery\"");
$layer->draw($map, $img);

and mapfile layer:
LAYER
 NAME leis
 TYPE POLYGON
 STATUS DEFAULT
 DATA blg_leis
 CLASSITEM "NAME"
 CLASS
   EXPRESSION "Buckingham Palace"
   COLOR 255 204 0
 END
END

Thanks,
Rob Chavez
Perseus Project




More information about the MapServer-users mailing list