Opened 19 years ago

Closed 17 years ago

#1367 closed defect (fixed)

symbolObj fixes for PHP Mapscript 4.6.0-beta2

Reported by: m.cave-ayland@… Owned by: dmorissette
Priority: high Milestone: 5.0 release
Component: MapScript-PHP Version: 4.6
Severity: normal Keywords:
Cc: mapserver@…

Description (last modified by dmorissette)

I've just been looking at dynamically creating symbols on the fly using PHP 
Mapscript, and found a couple of bugs which I believe I have fixed with the 
attached patches.


1) symbolObj has no imagepath property

	This was fixed by copying the code from mapsymbol.c to allow the 
imagepath property to be set via mapscript. I was a little unsure about how the 
current path should be handled, so at the moment it assumes that the path to the
GIF/PNG is absolute without considering the current path from the environment.


2) symbolObj->setPoints() doesn't correctly set symbolObj->sizex/sizey

	Using setPoints() to load an array of points for a vector symbol was 
not correctly setting sizex/sizey to the maximum extents of the symbol. Hence 
all symbols were being drawn with a size of 0 and did not appear to be
visible. This was fixed by borrowing the code from mapsymbol.c to set 
sizex/sizey to the maximum extents of the
symbol as points are added to the symbol.


Many thanks,

Mark.

Attachments (2)

ms-sym-imagepath.patch (3.5 KB ) - added by m.cave-ayland@… 19 years ago.
imagepath patch
ms-sym-setpoints.patch (818 bytes ) - added by m.cave-ayland@… 19 years ago.
setPoints patch

Download all attachments as: .zip

Change History (10)

by m.cave-ayland@…, 19 years ago

Attachment: ms-sym-imagepath.patch added

imagepath patch

by m.cave-ayland@…, 19 years ago

Attachment: ms-sym-setpoints.patch added

setPoints patch

comment:1 by dmorissette, 19 years ago

Milestone: 4.6 release
Thanks for the patch. Unfortunately I was unable to get to it in time for
4.6beta3 (being released today), but I'll try to integrate it next week.

comment:2 by mathieuparent@…, 19 years ago

blocked: 1164

comment:3 by mapserver@…, 19 years ago

Cc: mapserver@… added

comment:4 by dmorissette, 19 years ago

Cc: steve.lime@… added
Status: newassigned
I have applied patch #2 to set symbolObj->sizex/sizey, it's in CVS and will be
in 4.6.0.

With respect to patch #1, I don't think we should apply it as is, there are
already two places in the code that do a similary job of trying to identify the
symbol type (msAddImageSymbol() and loadSymbol()). I think that if we do
anything then we should do it well, merge some code, etc... but we're too close
to the release to take the risk of doing this now. Adding Steve to the CC in
case he has comments about this.

In the meantime, you can already use $style->set("symbolname", "filename.gif")
to create a pixmap symbol.

comment:5 by m.cave-ayland@…, 19 years ago

Hi Daniel, thanks for applying patch #2. I didn't realise that the functionality
for patch #1 could already be done by explicitly setting the symbolname property
(writing patches is a fun way to spend the afternoon) so I'm no rush to get it
applied. However, it's there for reference when you guys need it :)

comment:6 by sdlime, 19 years ago

I think Dan's right, holding off for the second patch until 4.7 makes sense too 
me...

Steve

comment:7 by dmorissette, 17 years ago

Description: modified (diff)
Owner: changed from mapserverbugs to dmorissette
Status: assignednew

comment:8 by dmorissette, 17 years ago

Resolution: fixed
Status: newclosed

This was fixed in v4.8 with the implementation of symbol.setImagePath() (ticket #1472, changeset r4871).

Note: See TracTickets for help on using tickets.