Opened 13 years ago
Last modified 13 years ago
#4016 new defect
pointObj draw - missing original coordinates
Reported by: | brunovani22 | Owned by: | aboudreault |
---|---|---|---|
Priority: | high | Milestone: | 6.0.1 release |
Component: | MapScript-PHP | Version: | 6.0 |
Severity: | normal | Keywords: | pointObj draw missing coordinates |
Cc: | dmorissette, sdlime |
Description
Hi, first, sorry if any mistakes, it is my first post. When using mapscript "draw" for a pointObj, the object loses its originals coordinates, assigning the image coordinates values.
by example-->
echo "before draw: ".$click_geo->x.", ".$click_geo->y."<br>";
$image = $map->draw(); #create map figure
$layer = $map->getLayerByName('virtual');
$click_geo->draw($map, $layer, $image, 0 ,'');
echo "after draw: ".$click_geo->x.", ".$click_geo->y."<br>";
output: before draw: 467738, 7543543 after draw: 346, 180
I try to use php clone for backup the value, but an error occurs:
Fatal error: Trying to clone an uncloneable object of class pointObj in...
The problem is that, internally, the point has to be transformed in pixel to be drawn. The behavior is the same using other bindings. The issue should also applied to drawShape, drawLine etc. I see 2 options:
What do you think?
About the clonable objects... I created a new ticket for this enhancement: #4032.