[Mapserver-users] problem with Layer on-fly with MapServer 4

Stéphane RIFF stephane.riff at cerene.fr
Mon Dec 8 11:14:36 EST 2003


I've already done that and it's works for me :

$newLayer = ms_newLayerObj($map);
$newLayer->set("connectiontype",6);
$newLayer->set("connection","host=localhost dbnmae=mapserver port=5432 
user=apache");
$expr = "the_geom from table";
$newLayer->set("data",$expr);
$newLayer->set("name","newLayer");
$newLayer->set("type",1);
$newLayer->set("status"),1);
$class1 = ms_newClassObj($newLayer);
$class1->set("name","result");
$class1->set("color",$map->addColor(255,255,0));

This works for me....


Andrés Collao wrote:

>
> this is correct!!!
>
> and I replace the constant , but without results, the problem persist.
>
> I try with numbers (0,1,2,3,4,5,6) , with the same result.
>
> thanks
>
> ::: Andrés Collao Pérez :::
> [ collao_andres at hotmail.com ]
> [ andres at mapserver.cl ]
>
> :::
> :::El hombre es un Dios cuando sueña y un mendigo cuando reflexiona.
> :::
> :::Il peggior nemico del succeso è la pauta del fallimiento
> :::El peor enemigo del éxito es el miedo al fracaso
> :::
>
>
> this
>
>
> ----Original Message Follows----
> From: Daniel Morissette <morissette at dmsolutions.ca>
> To: Andrés Collao <collao_andres at hotmail.com>
> CC: mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] problem with Layer on-fly with MapServer 4
> Date: Mon, 08 Dec 2003 10:25:25 -0500
>
> Andrés Collao wrote:
>
>> thank you, right now, i know the problem
>>
>> the mapfile don´t have de following porperties:
>> color
>> connectiontype
>> size
>> (these are the properties that I could prove)
>>
>> when i try use STYLE object this don't work , why? i don't know, but 
>> reading the /tmp/test.map i see I could observe that the properties 
>> for color, size were not written this also happen to CONNECTIONTYPE, 
>> when trying to form it dynamically, simply do not make
>>
>
> About the POSTGIS problem, your code contained the line:
>
>   $layer_tmp->set('connectiontype',POSTGIS);
>
> The constant for connection type POSTGIS is MS_POSTGIS and not POSTGIS.
>
> Daniel
> -- 
> ------------------------------------------------------------
>  Daniel Morissette               morissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
>
> _________________________________________________________________
> MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
>





More information about the mapserver-users mailing list