line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAttribute::Plugin::Locator::EZweb::GPS; |
2
|
|
|
|
|
|
|
# GPS |
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
217
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
6
|
use base qw( HTTP::MobileAttribute::Plugin::Locator::Base ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
91
|
|
6
|
1
|
|
|
1
|
|
6
|
use Geo::Coordinates::Converter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get_location { |
9
|
4
|
|
|
4
|
0
|
6
|
my ( $self, $params ) = @_; |
10
|
4
|
|
|
|
|
23
|
(my $lat = $params->{ lat }) =~ s/^[\-\+]//g; |
11
|
4
|
|
|
|
|
19
|
(my $lng = $params->{ lon }) =~ s/^[\-\+]//g; |
12
|
4
|
50
|
33
|
|
|
28
|
my $datum = defined $params->{ datum } && $params->{ datum } == 1 ? 'tokyo' : 'wgs84'; |
13
|
4
|
50
|
33
|
|
|
14
|
my $format = defined $params->{ unit } && $params->{ unit } == 1 ? 'degree' : 'dms'; |
14
|
4
|
|
|
|
|
20
|
return Geo::Coordinates::Converter->new( |
15
|
|
|
|
|
|
|
lat => $lat, |
16
|
|
|
|
|
|
|
lng => $lng, |
17
|
|
|
|
|
|
|
datum => $datum, |
18
|
|
|
|
|
|
|
format => $format, |
19
|
|
|
|
|
|
|
)->convert( 'wgs84' ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |