mapscript setExpression problems
Doyon, Jean-Francois
Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Fri Oct 20 09:32:59 PDT 2000
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