Opened 19 years ago
Last modified 17 years ago
#1367 closed defect
symbolObj fixes for PHP Mapscript 4.6.0-beta2 — at Version 7
Reported by: | Owned by: | dmorissette | |
---|---|---|---|
Priority: | high | Milestone: | 5.0 release |
Component: | MapScript-PHP | Version: | 4.6 |
Severity: | normal | Keywords: | |
Cc: | mapserver@… |
Description (last modified by )
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.
Change History (9)
by , 19 years ago
Attachment: | ms-sym-imagepath.patch added |
---|
comment:1 by , 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 , 19 years ago
blocked: | → 1164 |
---|
comment:3 by , 19 years ago
Cc: | added |
---|
comment:4 by , 19 years ago
Cc: | added |
---|---|
Status: | new → assigned |
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 , 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 , 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 , 17 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | assigned → new |
Note:
See TracTickets
for help on using tickets.
imagepath patch