Permalink
Browse files

added response method; add links to newer geocoders

  • Loading branch information...
gray committed Jul 6, 2010
1 parent 45bb6fd commit d4f09a073920e8b7027a5a9abda5cc8d925bdd85
Showing with 15 additions and 5 deletions.
  1. +14 −4 lib/Geo/Coder/Multimap.pm
  2. +1 −1 t/01_new.t
View
@@ -40,6 +40,8 @@ sub new {
return $self;
}
+sub response { $_[0]->{response} }
+
sub ua {
my ($self, $ua) = @_;
if ($ua) {
@@ -68,7 +70,7 @@ sub geocode {
$country ? (countryCode => $country) : (),
);
- my $res = $self->ua->get($uri);
+ my $res = $self->{response} = $self->ua->get($uri);
return unless $res->is_success;
my $data = eval { from_json($res->decoded_content) };
@@ -126,7 +128,7 @@ parameter should be given. Note, the C<country> parameter will produce
better results in most cases.
In scalar context, this method returns the first location result; and in
-list context it returns all locations results.
+list context it returns all location results.
Each location result is a hashref; a typical example looks like:
@@ -146,6 +148,13 @@ Each location result is a hashref; a typical example looks like:
'geocode_score' => '0.409'
}
+=head2 response
+
+ $response = $geocoder->response()
+
+Returns an L<HTTP::Response> object for the last submitted request. Can be
+used to determine the details of an error.
+
=head2 ua
$ua = $geocoder->ua()
@@ -157,8 +166,9 @@ Accessor for the UserAgent object.
L<http://www.multimap.com/openapidocs/1.2/web_service/ws_geocoding.htm>
-L<Geo::Coder::Bing>, L<Geo::Coder::Google>, L<Geo::Coder::Mapquest>,
-L<Geo::Coder::Yahoo>
+L<Geo::Coder::Bing>, L<Geo::Coder::Bing::Bulk>, L<Geo::Coder::Google>,
+L<Geo::Coder::Mapquest>, L<Geo::Coder::Navteq>, L<Geo::Coder::OSM>,
+L<Geo::Coder::TomTom>, L<Geo::Coder::Yahoo>
=head1 REQUESTS AND BUGS
View
@@ -5,4 +5,4 @@ use Geo::Coder::Multimap;
my $geo = Geo::Coder::Multimap->new(apikey => 'placeholder');
isa_ok($geo, 'Geo::Coder::Multimap', 'new');
-can_ok('Geo::Coder::Multimap', qw(geocode ua));
+can_ok('Geo::Coder::Multimap', qw(geocode response ua));

0 comments on commit d4f09a0

Please sign in to comment.