Skip Menu |
 

This queue is for tickets about the HTML-GoogleMaps CPAN distribution.

Report information
The Basics
Id: 118265
Status: new
Priority: 0/
Queue: HTML-GoogleMaps

People
Owner: Nobody in particular
Requestors: ekantons [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: HTML::GoogleMaps bug
Date: Tue, 4 Oct 2016 19:40:59 -0700
To: bug-HTML-GoogleMaps [...] rt.cpan.org
From: "Erik K. Antonsson" <ekantons [...] gmail.com>
Two suggestions for the perl module HTML::GoogleMaps 1. In sub _text_to_point the following line: return [ reverse @$point_text ] if ref( $point_text ) eq "ARRAY”; reverses the customary (and standard) ordering of global coordinates. I suggest that the ‘reverse’ be removed, so that the arguments are in the correct order (lat,long): return [ @$point_text ] if ref( $point_text ) eq "ARRAY”; 2. I also suggest that the apikey argument be provided to the Geo::Coder::Google module: geocoder => Geo::Coder::Google->new( apiver => 3, key => $api_key ), in the new sub: HTML::GoogleMaps::V3->new(…); Since the apikey is provided as an argument to the new sub, it can easily be pulled out of %opts and provided to the Google Geocoder. Doing so will make the code work in a wider array of circumstances. FYI, I have attached my edited version of V3.pm, however, I am sure that a more experienced perl coder can improve on my suggested modifications. I did not change the version number of the module in the attached version. -erik Erik K. Antonsson, Ph.D.
Two suggestions for the perl module HTML::GoogleMaps

1. In sub _text_to_point the following line:
  return [ reverse @$point_text ] if ref( $point_text ) eq "ARRAY”;
reverses the customary (and standard) ordering of global coordinates.
I suggest that the ‘reverse’ be removed, so that the arguments are in the correct order (lat,long):
  return [ @$point_text ] if ref( $point_text ) eq "ARRAY”;

2. I also suggest that the apikey argument be provided to the Geo::Coder::Google module:
        geocoder   => Geo::Coder::Google->new(
            apiver => 3,
            key => $api_key
            ),

in the new sub:

HTML::GoogleMaps::V3->new(…);
Since the apikey is provided as an argument to the new sub, it can easily be pulled out of %opts and provided to the Google Geocoder.  Doing so will make the code work in a wider array of circumstances.

FYI, I have attached my edited version of V3.pm, however, I am sure that a more experienced perl coder can improve on my suggested modifications.  I did not change the version number of the module in the attached version.

-erik
Erik K. Antonsson, Ph.D.
Download V3.pm
text/x-perl 10.4k

Message body is not shown because sender requested not to inline it.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.