[Cartoweb-users] locate plugin + overlay plugin seem not to worktogether

Stefan Neumeier stefan.neumeier at vti.bund.de
Fri Jan 7 08:22:05 EST 2011


  Dear all,
in the meantime I could figure out what to change to achieve this (add 
custom geostat legend to pdf output instead of original legend generated 
for pdf output).
Just in case anyone wants to do a similar thing, here the most basic 
steps I did:

1) In your project in ClientGeostat.php add function that builds custom 
a legend image etc.(one for every user and request)
2) transfer the path if the generated image and its dimensions via 
$_SESSION to CwFpdf.php
3) In CwFpdf.php in function  addLegendItem replace $icon content with 
path to your image
      adapt width and height

              $iWidth=$_SESSION['LegendWidth']/4;
              $iHeight=$_SESSION['LegendHeight']/4;

       adapt block size to fit legend images with dynamic sizes

              $block->width=$_SESSION['LegendWidth']/4;
              $block->height=$_SESSION['LegendHeight']/4;

              comment out the lines

             #  $iWidth  = 
PrintTools::switchDistUnit($this->general->legendIconWidth, 'pt',
             #                                        
$this->general->distUnit);
             #  $iHeight = 
PrintTools::switchDistUnit($this->general->legendIconHeight, 'pt',
             #                                        
$this->general->distUnit);




More information about the Cartoweb-users mailing list