[Mapserver-users] (2nd) Displaying a layer generated "on the fly" in a map

Stéphane MOREL stephane.morel at vanoise.com
Wed Mar 10 02:53:47 EST 2004


I do something very similar to you. I query a database build a shapefile 
on the fly and add the shapefile to the mapfile.
Here is a piece of code I use to do this

$lyr_resultat ="/home/mysite/mapserver/carto_bdd/tmp/requete".session_id();
$lyr = ms_newLayerObj($gpoMap);
$lyr->set("name","requete");
$lyr->set("type", MS_LAYER_POLYGON);
$lyr->set("status", MS_ON);
$lyr->set("data", $lyr_resultat);
$lyr->set("transparency","50");
$lyr->setprojection("proj=longlat,ellps=clrk80,no_defs");
$lyr->set("group","Données Galliformes");
$lyr->setmetadata("DESCRIPTION","Fiche(s) d'observation(s) sélectionnées");
$lyr->setmetadata("LYRNAME","Résultats de la requête");
$lyr->setmetadata("RESULT_FIELDS","CODE_OBSE");
$lyr->setmetadata("CHP_BDD","CODE_OBSERVATION");
$class_lyr = ms_newclassobj($lyr);
$class_lyr->set("name","données Galliformes");
$class_lyr->set("color",$gpoMap->addColor(255,0,255));

I hope this could help

Stéphane

Thomas Shaw Obregón wrote:

>(I'm sending this question for second time, to be sure it was sent
>successfuly to the mailing list)
>
>
>Hello, I'm now using mapserver4 and I have 3 layers in a map that I can
>pefectly visualize, the way I'm doing it is with the php-mapscript. Those
>3 layers are in shp format, but I also have to generate a new layer with
>some data inserted in a data base. The DB has 3 fields
>(latitude,longitude,price).
>I read the DB record by record and I'm generating  the layer 4 "on the
>Fly", when I finish it,I try to visualize it and it doesn't appears in the
>map, there only appears the first three layers. How can I do to visualize
>that 4rth layer in the map?
>
>I'll appreciate a lot if anyone  can help me with this.
>Thank
>
>
>_______________________________________________
>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