[Mapserver-users] point shape layer style and dynamic point data query

Sébastien DUBOIS sebastien.dubois at esm2.imt-mrs.fr
Tue Jun 15 03:28:21 EDT 2004


well i try to display a shape file put in a database postgresql with
shp2pgsql.....

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 in text
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 or put a symbol like a star!!


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 also 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? i saw old post but no example of drawing a box without
jbox and change the color of the point selected and then display the attributes
of the selected points....






-- 
Sébastien DUBOIS
1024D/A1140BCB:1BC8 7E21 4DA7 13D5 1B5F  876F F719 2B7A A114 0BCB





-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the mapserver-users mailing list