Updatating DATA value of a layer inside a mapfile
Gregor Mosheh
gregor at HOSTGIS.COM
Sat Oct 28 07:04:16 PDT 2006
> Luca Casagrande wrote:
>> I am trying to update the value DATA of a layer called visibility, using
>> php mapscript; those are the lines i am testing:
>> $this_layer = $map->getLayerByName('visibility');
>> $this_layer->set('data', $data_path );
>> $this_layer->set('status', MS_ON);
A month or two ago, I did this same trick (on the fly datasets, very cool)
and it worked A-OK. It worked, rather, after 2 days of frustration until I
found out that I had a typo in $data_path and was specifying the wrong
dataset for the layer! My symptom was exactly the same as yours: It only
works if I hardcode the data path, but not if I set it from the program.
So, do double check that $data_path is being set properly, and try
Daniel's idea of dumping the mapfile to disk and examining the generated
values.
More information about the MapServer-users
mailing list