Copyright notice at the lower left of the map image

Chad Streck chads at adci.com
Wed Mar 7 13:07:49 PST 2001


New to Mapserver, but enjoying every bit!  Started late last week.

I saw the short thread on copyrights on an image and saw the mapfile 
layer definition that added the copyright, but I was wondering if there 
is a way of doing the same/similar thing in mapscript.  I have been 
using PHP/Mapscript and a part of the app I'm writing includes changing 
the size of the map window, so I don't have static values to put the 
copyright in the lower right corner.  I need to be able to move it to 
the extent of my map window.

I tried using PHP to create something similar to the map file 
definition, but am unable to get anything to show, or add the text to a 
shapeobj.  Here is what I have so far...

// add copyright
function copyright($mapobj, $author, $txtwidth=50, $txtheight=10) {

       $layer = ms_newlayerobj($mapobj);

// add copyright
function copyright($mapobj, $author, $txtwidth=50, $txtheight=10) {

       $layer = ms_newlayerobj($mapobj);

       // base properties
       $layer->set('name', 'credits');
       $layer->set('status', 'default');
       $layer->set('transform', 'false');
       $layer->set('type', 'annotation');
       $layer->set('labe', 'annotation');

       // point feature with text for location
       $point = ms_newpointobj();
       $point->setXY($mapobj->width - $txtwidth, $mapobj->height - 
$txtheight);
       $line = ms_newlineobj();
       $line->add($point);

       $shape = ms_newshapeobj($layer);
       $shape->add($line);
                                       // make year computed
       //$shape->set('text', "© 2001 $author");


//int draw(mapObj map, layerObj layer, imageObj img,
//            string class_name, string text)

       $layer->addfeature($shape);

       // class for display
       //$layer->set('',);
//LAYER
//        NAME "credits"
//        STATUS DEFAULT
//        TRANSFORM FALSE
//        TYPE ANNOTATION
//        FEATURE
//                POINTS 4 369 END
//                TEXT '© 2001 ADCi'
//        END
//        CLASS
//                LABEL
//                        TYPE TRUETYPE
//                        FONT helv
//                        SIZE 8
//                        ANTIALIAS
//                        COLOR 0 0 255
//                        OUTLINECOLOR 255 255 255
//                        POSITION UR
//                END
//        END
//END

}

This does have extraneous comments while I am trying to get it to work, 
and I do know it doesn't work for me, so any help would be appreciated.

Thanks,
Chad




More information about the MapServer-users mailing list