in reply to Re^2: Drawing Shapefiles in Goo::Canvas
in thread Drawing Shapefiles in Goo::Canvas
You can only specify 1 array_ref, like $points = \@points and just use $points.my $way_lines = Goo::Canvas::Polyline->new($way_group, TRUE, $num_points, [\@points]); #here you have both the $points (assuming its an array_ref of points) # AND you have a nested array_ref in an array_ref ??? # [ \@points] ???? where did you come up with that?
Look closely at the example in Goo::Canvas Waypoint marker w zoom/save to svg and pdf and the man page for PolyLine. There are 2 ways to specify points when creating the PolyLine. One is to drop in an anonymous array_ref of x,y pairs. The other is to set the anonymous array_ref to undef, when creating the PolyLine, then after creation, set the points option to an array_ref. Additionally, if you later want to change(update) the points, the points must be a Goo::Canvas::Points object. The Goo::Canvas::Points object is just an object wrapper around the array_ref (look at my waypoint example closely), but the Goo::Canvas wants it that way.
Remember, the Goo::Canvas is still in development, and the author hasn't tightened up those dangling inconsistencies yet. But you can get it to work, with the steps outlined above.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Drawing Shapefiles in Goo::Canvas
by deadpickle (Pilgrim) on Jun 18, 2008 at 03:38 UTC | |
by zentara (Cardinal) on Jun 18, 2008 at 12:20 UTC |