how to addfeature to line layer by perl
Steve Lime
Steve.Lime at DNR.STATE.MN.US
Wed Jun 13 05:31:35 PDT 2007
The code below looks fine (might want some error checking, e.g. is
$layer valid), but we're missing the important part- the section that
calls save. I assume that's a mapObj or imageObj?
Steve
>>> huanxiang xu <huanxiangxu at YAHOO.COM.CN> 06/12/07 12:51 PM >>>
I know how to addfeature to point layer,
but how to addfeature to line layer
my $layer=$map->getLayerByName('cruise');
my $poi=new mapscript::pointObj(182.880000,14.090000);my $poi1=new
mapscript::pointObj(180.880000, 13.090000);
my $lin=new mapscript::lineObj();
$lin->add($poi);$lin->add($poi1);
my $shap=new mapscript::shapeObj();
$shap->add($lin);
#$layer->addFeature($shap);
return $map;
Is it right?
The perl give me the message: Can't call method "save" on an undefined
value
BR,
xu
---------------------------------
雅虎免费邮箱3.5G容量,20M附件!
More information about the MapServer-users
mailing list