Subject: | bug when passing variable to add_polyline or add_marker |
Date: | Thu, 12 Mar 2009 18:43:07 -0600 |
To: | bug-HTML-GoogleMaps [...] rt.cpan.org |
From: | Scott Bockelman <sbockelman [...] gmail.com> |
I have been using the HTML::GoogleMaps perl package. I have run into one
minor issue. Here is my code:
my $polyline = '[-96.160853, 41.232668], [-96.160885, 41.232635],
[-96.160761, 41.232542]';
my $map = HTML::GoogleMaps->new(key => $map_key);
$map->controls('small_map_control','map_type_control');
$map->center("Omaha, NE");
$map->add_marker(point => "1210 W Dayton St, Madison, WI");
$map->add_polyline(points => [ $polyline ]);
The map does not render when the coordinates are passed as a variable. I
get the following error:
"Use of uninitialized value in concatenation (.) or string at
/usr/local/share/perl/5.10.0/HTML/GoogleMaps.pm line 454."
However, it does work if the coordinates are set like this:
$map->add_polyline(points => [ [-96.160853, 41.232668], [-96.160885,
41.232635], [-96.160761, 41.232542] ]);
The same happens when using the add_marker routine.
Any assistance would be appreciated.
uname -a
Linux server 2.6.27-11-generic #1 SMP Thu Jan 29 19:24:39 UTC 2009 i686
GNU/Linux
perl -v
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
Copyright 1987-2007, Larry Wall
Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Thanks,
Scott Bockelman