Opened 22 years ago
Closed 21 years ago
#251 closed defect (duplicate)
Legend icons off-center, so that top and left lines get cut off
Reported by: | Owned by: | dmorissette | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapScript-PHP | Version: | 4.0 |
Severity: | normal | Keywords: | |
Cc: |
Description
Using 3.7 CVS version from 12/31/02. Legend icons are now off-center, at least when produced using createLegendIcon(). The rectangular 20x10 image is being produced, but the icon is shifted one pixel to the left, and one pixel to the top, so that white lines appear on the right and bottom edges. For polygon layers with an outlinecolor, this means that no outline color appears on the left and upper edges of the icon. The problem also affects point and line icons...the top line of each icon is visibly shaved off. One more thing...for polygon layers that *do not* have an outlinecolor, the bottom row of pixels is all white, except for the pixel at the bottom right corner of the image. This problem was already there, though (not new). Examples of all these at http://www.nacse.org/~keon/temp/icons
Change History (5)
comment:1 by , 22 years ago
Cc: | added |
---|
comment:3 by , 21 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
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"; ?>
comment:4 by , 21 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
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"; ?>
comment:5 by , 21 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
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 ***
Note:
See TracTickets
for help on using tickets.