mapscript: access to the class members
Alberto GEMELLI
alberto.gemelli at jrc.it
Sun Apr 8 13:23:12 PDT 2001
This is about how to access to layerObject data member, using mapscript
for Perl5.
this is my code:
$map = new mapObj(undefined) or die('Unable to open mapfile.');
$map->{extent}->{minx} = $minx;
$map->{extent}->{maxx} = $maxx;
$map->{extent}->{miny} = $miny;
$map->{extent}->{maxy} = $maxy;
$map->{width} = $xsize;
$map->{height} = $ysize;
$layer = new layerObj($map);
$layer->{name} = 'nnn';
$layer->{type} = 'line';
$layer->{data} = $xxx;
$class = new classObj($layer};
$class->{color}->{r} = 255;
$class->{color}->{g} = 100;
$class->{color}->{b} = 100;
$img = $map->draw() or die('Unable to draw map');
mapscript::msSaveImage($img, undef, $map->{interlace},
$map->{transparent} );
Question 1)
There must be an arror in the syntax. The main target of this program
would be to access to the
DATA member of layerObj. Which is the correct syntax to do that?
Question 2)
in order to draw a multiple layers image, when should I use use the
$map->draw() method and when the
$layer->draw() method;
Suggestions and examples are welcome.
More information about the MapServer-users
mailing list