Closed tbonfort closed 12 years ago
Author: keon@nacse.org Date: 2003/01/30 - 01:24
I'm curious whether anyone else has noticed this same behavior (the URL
illustrates it pretty well). I've tried it several times with different CVS
versions and it's consistent. For now I'm using a static legend that I produced
using createLegendIcon() in 3.6.3. I'm hoping to use 3.7 again to create
dynamic legends. Thanks.
Author: dmorissette Date: 2003/01/30 - 02:50
I tried this on two systems with recent copies of MapServer 3.7, one of them
running GD 1.8.4 and the other running GD 2.0.9 and in both cases the legend
icons are centered properly. In both cases I was using a PHP script that I'll
copy below. I also made a quick test with the mapserv CGI and things seemed
fine as well.
Are there any other details you can provide to help reproduce this? I saw your
webpage but unfortunately I can't reproduce the problem. I'll close the bug as
WORKSFORME, please reopen it if you can provide more details to reproduce it.
Test script:
<?php
dl("php_mapscript_37.so");
$gpoMap = ms_newMapObj("gmap75.map");
// --------------
// Try with a point layer
$layer = $gpoMap->getLayerByName("popplace");
$myClass = $layer->GetClass(0);
$img = $myClass->createLegendIcon($gpoMap->keysizex, $gpoMap->keysizey);
$url = $img->saveWebImage();
echo "<img src=$url> ".$layer->name. "<br>\n";
// --------------
// Try with a polygon layer
$layer = $gpoMap->getLayerByName("park");
$myClass = $layer->GetClass(0);
$style = $myClass->getStyle(0);
$style->outlinecolor->setRGB(255, 0, 0);
$img = $myClass->createLegendIcon($gpoMap->keysizex, $gpoMap->keysizey);
$url = $img->saveWebImage();
echo "<img src=$url> ".$layer->name. "<br>\n";
?>
Author: keon@nacse.org Date: 2003/01/30 - 07:59
Daniel, thanks for looking into this. I moved everything to a new server
yesterday and today, and I'm no longer seeing most of the problems. Not sure
why they were occurring.
However, one small problem persists. When creating legend icons for a polygon
layer that doesn't have an outlinecolor, the bottom line of the icon is not
filled in (except for the last pixel on the right). You can see this example on
the URL that I gave you...it's the last example on the page.
I used part of your script against a layer of that type, and encountered the
same behavior. I'm using MS CVS from today and GD 2.0.11.
<?php
dl("php_mapscript.cvs.01-29-03.so");
$map = ms_newMapObj("test.map");
// Try with a polygon layer with no outlinecolor
$layer = $map->getLayerByName("watersheds");
$myClass = $layer->GetClass(0);
//$style = $myClass->getStyle(0);
//$style->outlinecolor->setRGB(255, 0, 0);
$img = $myClass->createLegendIcon($map->keysizex, $map->keysizey);
$url = $img->saveWebImage();
echo "<img src=$url> ".$layer->name. "<br>\n";
?>
Author: dmorissette Date: 2003/07/10 - 05:28
The bottom line and corner pixel issue was fixed in bug 336 in version 4.0
*** This bug has been marked as a duplicate of 336 ***
Reporter: keon@nacse.org Date: 2003/01/01 - 01:53