Opened 18 years ago

Closed 13 years ago

#1684 closed defect (fixed)

can't control pixmap symbol size

Reported by: akrherz@… Owned by: mapserverbugs
Priority: high Milestone:
Component: MapScript-PHP Version: 4.8
Severity: normal Keywords:
Cc: mapserver@…

Description (last modified by tbonfort)

Back in the 4.6.1 days, this code would work:

$logokey = ms_newLayerObj($map);
$logokey->set("type", MS_SHP_POINT);
$logokey->set("transform", MS_FALSE);
$logokey->set("status", MS_ON);
$logokey->set("labelcache", MS_ON);

$logokey_c3 = ms_newClassObj($logokey);
$logokey_c3s0 = ms_newStyleObj($logokey_c3);
$logokey_c3s0->set("symbolname", "iem");
$logokey_c3s0->set("size", 45);
$logokey_c3->label->set("buffer", 10);
$logokey_c3->label->set("type", MS_BITMAP);
$logokey_c3->label->set("size", MS_MEDIUM);
$logokey_c3->label->color->setRGB(0,0,0);
$bpt = ms_newpointobj();
$bpt->setXY(300, 300);
$bpt->draw($map, $logokey, $img, 0 , "      ");

Now in 4.8.1, I can't controll the size of the symbol:

$logokey_c3s0->set("size", 45);

does nothing.  Am I doing something wrong?

Change History (7)

comment:1 by javerbach@…, 18 years ago

Resolution: fixed
Status: newclosed
Summary: can't control pixmap symbol size can't control pixmap symbol size
 * Revision 1.93  2006/03/02 01:51:13  jani
 * When we add a pixmap symbol, be sure to initialize sizex,sizey fields of
 * symbol. These fields are used later (e.g.mapgd.c:msDrawMarkerSymbolGD)
 * to calculate scaling factor.  If they are uninitialized (0.0),
 * the scaling factor will be 1. This worked before with the old code because
 * msDrawMarkerSymbolGD used directly img->sy when it calculated
 * d (the scaling factor).
 *
 * This fixes bug #1684
 *
 * * msAddImageSymbol: Initialize sizex, sizey
 *

comment:2 by akrherz@…, 18 years ago

Resolution: fixed
Status: closedreopened
Hi,

Sorry, I just checked out CVS and the problem still exists with PHP mapscript.

daryl

comment:3 by mapserver@…, 18 years ago

Cc: mapserver@… added

comment:4 by javerbach@…, 18 years ago

mapsymbol.c: 1.94: 
Fixed second code path when same thing happens (Image loaded by symbol file). 

Daryl, could you test cvs-head and close this bug, if it is now fixed.

Thanks, 
Jani

comment:5 by akrherz@…, 18 years ago

Hi,

Thanks.  You are getting closer, but something is still funky.  In 4.6.1, the
SIZE setting seemed to control the pixmap height.  Now in CVS HEAD, it appears
to control the pixmap width.  Is that correct?

daryl

comment:6 by benjcarson@…, 18 years ago

Part of the current fix for this bug seems to break scalebar embedding.  I think
the problem is that the scalebar is added as a symbol to the symbolset but that
the sizey member of the sclaebar's symbolObj is set to zero.  When the scale
factor is calculated (d = size / symbol->sizey in mapgd.c:1745), d then becomes
+inf.

Adding these lines to mapscale.c:339 seems to fix this:

  map->symbolset.symbol[s].sizey = image->img.gd->sy;
  map->symbolset.symbol[s].sizex = image->img.gd->sx;


Benj

comment:7 by tbonfort, 13 years ago

Description: modified (diff)
Resolution: fixed
Status: reopenedclosed

irrelevant with the 6.0 rendering overhaul.

Note: See TracTickets for help on using tickets.