pointObj point.draw(..)

Eric Bridger eric at GOMOOS.ORG
Wed Feb 2 06:58:53 PST 2005


At 03:37 PM 02/02/2005 +0100, Jose Luis Gonzalez wrote:
>Hello to everybody
>I have finally solved how to draw a point on my map.
>But I have an other doubt: in the definition of the draw method of the pointObj you have a text parameter. I thought that that would be writen next to the point, but it doesn't. Is that normal?Is it just a reference to name the point in some way?
>this is my program:
>
>                mapObj map = new mapObj("mymap.map");
>                imageObj img=map.draw();
>                layerObj point_layer=new layerObj(map);
>                point_layer=map.getLayerByName("Point");
>                pointObj pt=new pointObj(3460000,5540000,0,0);
>                pt.draw(map,point_layer,img,0,"point1");
>
>And part of my .map file:
>
>   LAYER
>     NAME "Point"
>       TYPE POINT
>       STATUS DEFAULT
>       CLASS
>          STYLE
>            COLOR 255 0 0
>          END
>   END
>   END
>
>If I want to draw a text next to the point, what do I have to use, a labelObj?

Yes. You will need a LABEL section in your CLASS section in your map file.
And you will probably need to call  map.drawLabelCache().



More information about the MapServer-users mailing list