payprop / html-googlemaps-v3

Fork of HTML::GoogleMaps to fix issues
2 stars 1 forks source link

api_key option - does it do anything? #4

Closed nigelhorne closed 8 years ago

nigelhorne commented 8 years ago

Does the api_option to the constructor work? I am getting

Google Maps API returned status 'OVER_QUERY_LIMIT' at /home/njh/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/HTML/GoogleMaps/V3.pm line 94.

and my Google console says I've done no queries using the key. Here is my usage:

                            my %args;
                            if($opts{'M'}) {
                                    $args{'api_key'} = $opts{'M'};
                            }
                            $map = HTML::GoogleMaps::V3->new(%args);

I've added print statements, $opts{'M'} is being set with the key.

nigelhorne commented 8 years ago

Here is the exact wording that Google returns, which is why I started wondering if the option does anything:

{ "errormessage" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=", "results" : [], "status" : "OVER_QUERY_LIMIT" }

leejo commented 8 years ago

Yes, it is. I've added a test case as can be seen in the above commit. Please re-open if you find a problem with the module, seems ok to me and to spec.