Updatating DATA value of a layer inside a mapfile

Luca Casagrande luca.casagrande at GMAIL.COM
Sat Oct 28 11:33:20 EDT 2006


Thanks for your answer mates!
I have used the $map->save("/tmp/test.map") to debug the mapfile, and i
discovered that the error was a wrong parsing of the $data_path.
Thanks for the save function, it's very usefull for debugging mapscript
application!

Bye
Luca

On 10/28/06, Gregor Mosheh <gregor at hostgis.com> wrote:
>
> > 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061028/715be40a/attachment.html


More information about the mapserver-users mailing list