[mapserver-users] question on CLASSITEM

Puneet Kishor pkishor at GeoAnalytics.com
Wed May 29 17:47:21 EDT 2002


mapfile (only relevant lines shown) --

LAYER
	NAME "layer_highlight"
	STATUS off
	CLASSITEM "blah"
	CLASS
		...classdef...
	END
  	TEMPLATE "foo"
END

mapscript (only relevant lines shown) given $expr for "blah" --

$layerObj = $mapObj->getlayerbyname("layer_highlight");
$classObj = $layerObj->getClass(0);
$classObj->setexpression("/$expr/");
$layerObj->set("status", 1);

this turns on "layer_highlight" and highlights the features that match
CLASSITEM "blah" to "$expr".

The problem is thus -- if $expr exists then features are correctly matched
in the layer. However, if $expr == "", then all the features end up getting
matched... what I want is that if $expr == "" then the layer should turn on,
however, no feature should show up since no feature is matched.

Any ideas?

pk/



More information about the mapserver-users mailing list