in reply to OLE & Array (MapPoint addPollyLine)

Try passing @ary by reference in case MapPoint expects an array of locations:
my $x = $Map->Shapes->addPolyLine(\@ary);

Replies are listed 'Best First'.
Re: Re: OLE & Array (MapPoint addPollyLine)
by zakzebrowski (Curate) on Oct 09, 2003 at 16:57 UTC
    Sweet! The following code produces the following maps...:
    use Win32::OLE qw(in with); use Win32::OLE::Const; use Win32::OLE::Const 'Microsoft MapPoint'; use Win32::OLE::Variant; $Win32::OLE::Warn = 3; # die on errors... my $MapPoint = Win32::OLE->new('MapPoint.Application', 'Quit'); my $Map = $MapPoint->NewMap(); my $Results = $Map->FindPlaceResults("California"); my $second = $Map->findPlaceResults("Massachusetts"); my $Location = $Results->Item(1); $Location->GoTo; my $secLocation = $second->Item(1); my @ary = ($Location,$secLocation); my $x = $Map->Shapes->addPolyLine(\@ary); $x->{Line}->{EndArrowhead}=True; $Map->{Altitude} = $Map->{Altitude}*4; # adjust zoom $Map->SaveAs("yahoox", 2); # saves in /mydocuments/yahoox.htm /mydocum +ents/yahoox_files/image_map.jpg & /my documents/yahoox_files/image_ov +erview.jpg (image_overview.jpg seems to always be the same image...) $Map->{Altitude} = $Map->{Altitude}*40; $Map->SaveAs("yahoo", 2); $Map->{Saved} = -1;
    map1
    map2


    ----
    Zak
    undef$/;$mmm="J\nutsu\nutss\nuts\nutst\nuts A\nutsn\nutso\nutst\nutsh\ +nutse\nutsr\nuts P\nutse\nutsr\nutsl\nuts H\nutsa\nutsc\nutsk\nutse\n +utsr\nuts";open($DOH,"<",\$mmm);$_=$forbbiden=<$DOH>;s/\nuts//g;print +;