Passing Variable to a Map File

Damon Broglie brog at MAIL.UTEXAS.EDU
Tue Dec 6 13:36:47 PST 2005


Thanks for the info Ken, but the gMap Factory applications run MapScript, 
and I like the look and feel of the applications.

To simplify things and try to hunt down the problem, I have tried creating 
a new point layer which should take a shapefile as its DATA attribute.

In my map file, I created a layer called "shpvar" with class and style 
attributes.  The only thing missing from the layer is the DATA parameter 
(which is set to nothing, i.e. the text box in MapLab is blank).

I added the following line to my <project>.php file in 
"maplab/projects/gmf_apps/<project>/" just after the "Process map size" header:

//ADDED
$shpvarLayer = $oMapSession->oMap->getLayerByName("shpvar");
$shpvarLayer->set("status",MS_ON);
$shpvarLayer->set("data", "./us-counties-centroids");

When I run the application to view the map, the layer gets turned on in the 
table of contents,  but none of the points show up on the map.

Any suggestions?



More information about the MapServer-users mailing list