Changes between Initial Version and Version 1 of PerlShapeObj4


Ignore:
Timestamp:
Jan 29, 2009, 11:26:08 AM (13 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PerlShapeObj4

    v1 v1  
     1= shapeObj =
     2
     3== drawing lines with mapscript ==
     4 
     5...class definition in the map file needed a style section (even if it is empty)...
     6{{{
     7#!perl
     8$layer = $map->getLayerByName('line_layer');
     9$layer->{status} = 1;
     10my $linePoint1 = new mapscript::pointObj();
     11$linePoint1->{x} = 272048; $linePoint1->{y} = 199772;
     12my $linePoint2 = new mapscript::pointObj();
     13$linePoint2->{x} = 272450; $linePoint2->{y} = 200074;
     14my $line = new mapscript::lineObj();
     15$line->add($linePoint1);
     16$line->add($linePoint2);
     17my $shape = new mapscript::shapeObj($mapscript::MS_SHAPE_LINE);
     18$shape->add($line);
     19$shape->{text} = "LINE TEXT";
     20$shape->draw($map, $layer, $img);
     21}}}
     22----------------------------------
     23{{{
     24LAYER
     25NAME "line_layer"
     26STATUS ON
     27PROJECTION
     28"init=epsg:26958"
     29END
     30TYPE LINE
     31CLASS
     32STYLE
     33END
     34LABEL
     35ANGLE AUTO
     36FONT arial
     37TYPE TRUETYPE
     38POSITION UC
     39SIZE 7
     40COLOR 0 0 0
     41END
     42COLOR 0 0 0
     43SIZE 10
     44END
     45END
     46}}}
     47----
     48back to PerlMapScript