mapscript setExpression problems
Robert Chavez
rchavez at perseus.tufts.edu
Fri Oct 20 09:49:52 PDT 2000
Hi J.F.,
I thought of that too, but no dice. I also thought of leaving them out,
but then I get the usage error:
Usage: classObj_setExpression(self,string); at IncPerl/mapscript.pm line
694.
I may need to hunt down the function in the C code.
Thanks,
Rob
On Fri, 20 Oct 2000, Doyon, Jean-Francois wrote:
> Humm, well my first thought would be about those escaped double-quotes ...
> do you really need them ?
>
> Wouldn't just $class->setExpression("Bankside Gallery");
>
> work ? Of course if the double quotes are IN the DBF, that could be weird
> ...
>
> J.F.
>
> > ----------
> > From: Robert Chavez[SMTP:rchavez at perseus.tufts.edu]
> > Sent: Friday, October 20, 2000 10:57 AM
> > To: mapserver-users at lists.gis.umn.edu
> > Subject: mapscript setExpression problems
> >
> >
> > 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