Geo::Coder::GoogleMaps::Response - Response object for the Geo::Coder::GoogleMaps module.
Version 0.4 (follow Geo::Coder::GoogleMaps version number)
This module provides a convenient way to represent a response for a geocoding request to Google's servers.
Those constants are giving hints about the status of a geocoding request.
G_GEO_SUCCESS: No errors occurred; the address was successfully parsed and its geocode has been returned. G_GEO_BAD_REQUEST: A directions request could not be successfully parsed. G_GEO_SERVER_ERROR: A geocoding, directions or maximum zoom level request could not be successfully processed, yet the exact reason for the failure is not known. G_GEO_MISSING_QUERY: The "location" parameter was either missing or had no value. G_GEO_MISSING_ADDRESS: Synonym for G_GEO_MISSING_QUERY. G_GEO_UNKNOWN_ADDRESS: No corresponding geographic location could be found for the specified address. G_GEO_UNAVAILABLE_ADDRESS: The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons. G_GEO_BAD_KEY: The given key is either invalid or does not match the domain for which it was given. G_GEO_TOO_MANY_QUERIES: The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.
The object constructor it takes no parameters
Return true if the the request was successfull and there is actually some placemarks in the list, false otherwise.
If the exact failure reason is needed, please use Geo::Coder::GoogleMaps::Response::status_code() and check with the available constants.
unless( $response->is_success() ){ print "WARNING: Address is unknown by Google's server !\n" if( $response->status_code() == G_GEO_UNKNOWN_ADDRESS ); }
Returns the response status code. This code can be tested against the G_GEO_* constants.
if( $response->status_code() == Geo::Coder::GoogleMaps::Response::G_GEO_BAD_KEY ) print "Please provide a valid Google Maps API key and try again.\n";
Returns the complete response status. The status is a hashref which looks like that :
status => { code => -1, request => "" }
Adds the placemark (a Geo::Coder::GoogleMaps::Location object) given in parameter to the list of placemarks.
This methods croak on errors (like if you did not give a proper object in argument).
Return the complete list of placemarks, or an arrayref depending on the context.
In any case the array contains a list of Geo::Coder::GoogleMaps::Location objects.
Remove all the placemarks from the response object.
Reset the response object's status to its initial state (undefined).
Arnaud Dupuis, <a.dupuis at infinityperl.org>
<a.dupuis at infinityperl.org>
Please report any bugs or feature requests to bug-geo-coder-googlemaps at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-Coder-GoogleMaps. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-geo-coder-googlemaps at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Geo::Coder::GoogleMaps::Response
You can also look for information at:
Infinity Perl:
http://www.infinityperl.org
Google Code repository
https://code.google.com/p/geo-coder-googlemaps/
Google Maps API documentation
http://code.google.com/apis/maps/documentation/geocoding/
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Geo-Coder-GoogleMaps
CPAN Ratings
http://cpanratings.perl.org/d/Geo-Coder-GoogleMaps
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Geo-Coder-GoogleMaps
Search CPAN
http://search.cpan.org/dist/Geo-Coder-GoogleMaps
Slaven Rezic (SREZIC) for all the patches and his useful reports on RT.
Copyright 2007-2010 Arnaud DUPUIS, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Geo::Coder::GoogleMaps, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Coder::GoogleMaps
CPAN shell
perl -MCPAN -e shell install Geo::Coder::GoogleMaps
For more information on module installation, please visit the detailed CPAN module installation guide.