File Coverage

blib/lib/HTTP/MobileAttribute/Plugin/Locator/ThirdForce/GPS.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition 1 2 50.0
subroutine 5 5 100.0
pod 0 1 0.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package HTTP::MobileAttribute::Plugin::Locator::ThirdForce::GPS;
2             # S!GPS
3 1     1   5 use strict;
  1         2  
  1         36  
4 1     1   6 use warnings;
  1         1  
  1         32  
5 1     1   5 use base qw( HTTP::MobileAttribute::Plugin::Locator::Base );
  1         2  
  1         94  
6 1     1   6 use Geo::Coordinates::Converter;
  1         3  
  1         9  
7              
8             sub get_location {
9 4     4 0 9 my ( $self, $params ) = @_;
10 4         24 my ( $lat, $lng ) = $params->{ pos } =~ /^[NS]([\d\.]+)[EW]([\d\.]+)$/;
11 4   50     22 my $datum = $params->{ geo } || 'wgs84';
12 4         18 return Geo::Coordinates::Converter->new(
13             lat => $lat,
14             lng => $lng,
15             datum => $datum,
16             )->convert;
17             }
18              
19             1;