moving an existing point

Camden Daily cdaily at GMAIL.COM
Fri Jun 3 07:53:20 PDT 2005


I'm not sure why the changes aren't 'sticking', but as a solution you
could just generate your  logo layer entirely in mapscript, without
having to have anything in the map file.  Here's the function I use to
do that for our maps, and I'm sure you could adjust it to suit your
needs:


///////////////////////////////////////////////////////////////
// function imprint()
//
// places a watermark in the lower left hand corner of the map
///////////////////////////////////////////////////////////////

function imprint($string) {
  global $map;

  $layer = ms_newLayerObj($map);
  $layer->set("name", "imprint");
  $layer->set("type", MS_LAYER_ANNOTATION);
  $layer->set("status", MS_ON);
  $layer->set("transform", MS_FALSE);
  $class = ms_newClassObj($layer);
  $point = ms_newPointObj();
  $point->setXY(5, $map->height - 3);
  $line = ms_newLineObj();
  $line->add($point);
  $shape = ms_newShapeObj(MS_SHAPE_POINT);
  $shape->add($line);
  $shape->set("text", $string);  
  $layer->addFeature($shape);
  $label = $class->label;
  $label->set("font", "arial-bold");
  $label->set("type", MS_TRUETYPE);
  $label->set("size", 10);  
  $label->set("position", MS_UR);
  $label->set("force", MS_TRUE);
  $label->set("buffer", 5);
  $label->color->setRGB(230, 230, 250);
  $label->outlinecolor->setRGB(0, 0, 0);
     
}

Camden Daily
Prudential Preferred Properties
http://www.prupref.com



More information about the MapServer-users mailing list