Changes between Initial Version and Version 1 of PerlLineObj4


Ignore:
Timestamp:
Jan 29, 2009, 11:24:18 AM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PerlLineObj4

    v1 v1  
     1= lineObj =
     2
     3== Drawing lines with mapscript ==
     4(class definition requires a style - even if blank) (LINE type layer is rendered using COLOR and ignores OUTLINECOLOR)
     5{{{
     6CLASS
     7STYLE
     8END
     9}}}
     10--------------------------------------------------------------------
     11{{{
     12#!perl
     13$layer = $map->getLayerByName('line_layer');
     14$layer->{status} = 1;
     15my $linePoint1 = new mapscript::pointObj();
     16$linePoint1->{x} = 272048; $linePoint1->{y} = 199772;
     17my $linePoint2 = new mapscript::pointObj();
     18$linePoint2->{x} = 272450; $linePoint2->{y} = 200074;
     19my $line = new mapscript::lineObj();
     20$line->add($linePoint1);
     21$line->add($linePoint2);
     22my $shape = new mapscript::shapeObj($mapscript::MS_SHAPE_LINE);
     23$shape->add($line);
     24$shape->{text} = "LINE TEXT";
     25$shape->draw($map, $layer, $img);
     26}}}
     27----
     28back to PerlMapScript