File Coverage

blib/lib/HTTP/MobileAgent/Plugin/Locator/EZweb/BasicLocation.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition 2 4 50.0
subroutine 4 4 100.0
pod 1 1 100.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package HTTP::MobileAgent::Plugin::Locator::EZweb::BasicLocation;
2             # Simple Location Information
3              
4 1     1   5 use strict;
  1         2  
  1         43  
5 1     1   6 use base qw( HTTP::MobileAgent::Plugin::Locator );
  1         2  
  1         96  
6 1     1   6 use Geo::Coordinates::Converter;
  1         2  
  1         9  
7              
8             sub get_location {
9 6     6 1 8 my ( $self, $params ) = @_;
10 6         10 my $lat = $params->{ lat };
11 6         8 my $lng = $params->{ lon };
12 6   50     16 my $datum = $params->{ datum } || 'wgs84';
13 6   50     22 my $format = $params->{ unit } || 'dms';
14 6         24 return Geo::Coordinates::Converter->new(
15             lat => $lat,
16             lng => $lng,
17             datum => $datum,
18             format => $format,
19             )->convert;
20             }
21              
22             1;