[mapserver-users] How to create TEMPLATE dynamically under php (fwd)

Daniel Morissette morissette at dmsolutions.ca
Fri Nov 9 11:08:33 EST 2001


Frederic,

A simple call to $fredclass->set("template", "ttt_query.html"); should
work with MapServer 3.5 ... did you try that?  If it didn't work then
wihch error did you get?

Daniel


> From: "CATHIGNOL, Frederic" <Frederic.CATHIGNOL at astrium-space.com>
> Hello from France;
> 
> I certainly miss something, but I would like to transform this .MAP code in
> PHP :
> LAYER
>   NAME xx
>   METADATA
>     "DESCRIPTION"   "xx"
>     "RESULT_FIELDS" "NAME"
>   END
>   TYPE POLYGON
>   STATUS OFF
>   DATA xx
>   CLASS
>     NAME "xx"
>     COLOR 200 255 0
>     OUTLINECOLOR 120 120 120
>     TEMPLATE "ttt_query.html"
>   END
>   TOLERANCE 5
> END # Layer
> 
> I do not know how to create the TEMPLATE line. How do you do that ?
> 
> I tried the code here after, but I block on the template tag :
> $layer = ms_newLayerObj($gpoMap);
> $layer->set("name","xx");
> $layer->set("type", MS_LAYER_POLYGON);
> $layer->set("data", "xx");
> $layer->set("status", MS_ON);
> $layer->setMetaData("DESCRIPTION","xx");
> $layer->setMetaData("RESULT_FIELDS","NAME");
> $fredclass = ms_newClassObj($layer);
> $fredclass->set("name","xx");
> $fredclass->set("color",2);
> $fredclass->set("outlinecolor",2);
> 
> Thanks Guys for your help to a french developper !
> (frederic.cathignol at bigfoot.com)
> 
> Best regards,
> 
> F.CATHIGNOL



More information about the mapserver-users mailing list