[Mapserver-users] point shape layer style and dynamic point data query
Sébastien DUBOIS
sebastien.dubois at esm2.imt-mrs.fr
Mon Jun 14 04:49:10 PDT 2004
well i try to display a shape file put in a database postgresql with
phpmapscript
i suceed in but i don't understand how to change the style of the output.
yet the points of my database layer can be displayed by their position
POINT (X,Y) with $label->set("position",MS_CC);
But if i don(t put this line my points are only dispayed by one pixel.
i can't change the size!!
this is one part of the code i use
-------------------------
$map = ms_newMapObj($Nom_Mapfile);
$map->setextent($xmin,$ymin,$xmax,$ymax);
$map->web->set("imagepath",$mapserver_imagepath);
$map->web->set("imageurl",$mapserver_imageurl);
$map->set("width",$longueur_image_mapfile);
$map->set("height",$hauteur_image_mapfile);
$layer = ms_newLayerObj($map);
$layer->set("name",$base_de_donnees);
$layer->set("status",MS_DEFAULT);
$layer->set("connectiontype",MS_POSTGIS);
$layer->set("connection","user=".$utilisateur."
dbname=".$base_de_donnees." host=".$hote);
$layer->set("data",$colonne_geometrique." from ".$table_choisie." as foo
using unique geometry_columns.srid using SRID=-1");
$layer->set("type",$type_donnee_geometrique_pour_mapserver);
$layer->set("labelitem",$mapserver_labelitem);
$class = ms_newClassObj($layer);
$label = $class->label;
$label->set("position",MS_CC);
$label->color->setRGB(0,0,0);
$label->outlinecolor->setRGB(255,0,0);
$label->shadowcolor->setRGB(255,255,255);
$label->backgroundcolor->setRGB(0,0,255);
$label->backgroundshadowcolor->setRGB(255,255,255);
$style = ms_newStyleObj($class);
$style->set("size",4);
$style->outlinecolor->setRGB(128,0,0);
$image = $map->draw();
$image_url = $image->saveWebImage(MS_PNG,1,1,0);
----------------------
I try to put a symbol in my .map and define the layer as i used to without
phpmapscript but i doesn't work.
Is there someone who can explain me how to proceed.
how create $symbole in phpmapscript.
Perhaps i need to create a point object??
thanks in advance
other question is there someone here who suceed in writing a dynamic point data
query in phpmapscript?
--
Sébastien DUBOIS
Ecole Généraliste d'Ingénieurs de Marseille (ex ESM2)
1024D/A1140BCB
Empreinte de la clé = 1BC8 7E21 4DA7 13D5 1B5F 876F F719 2B7A A114 0BCB
disponible sur www.keyserver.net
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
More information about the MapServer-users
mailing list