|
Revision 2652, 466 bytes
(checked in by clouder, 5 years ago)
|
|
lang/perl/HTTP-MobileAgent?-Plugin-Locator: modifiled to apply Apache::Request and CGI instance, and return G::C::C::Point instance
|
| Line | |
|---|
| 1 | package HTTP::MobileAgent::Plugin::Locator::DoCoMo::GPS; |
|---|
| 2 | # GPS |
|---|
| 3 | |
|---|
| 4 | use strict; |
|---|
| 5 | use base qw( HTTP::MobileAgent::Plugin::Locator ); |
|---|
| 6 | use Geo::Coordinates::Converter; |
|---|
| 7 | |
|---|
| 8 | sub get_location { |
|---|
| 9 | my ( $self, $params ) = @_; |
|---|
| 10 | my $lat = $params->{ lat }; |
|---|
| 11 | my $lng = $params->{ lon }; |
|---|
| 12 | my $datum = $params->{ geo }; |
|---|
| 13 | return Geo::Coordinates::Converter->new( |
|---|
| 14 | lat => $lat, |
|---|
| 15 | lng => $lng, |
|---|
| 16 | datum => lc $datum, |
|---|
| 17 | )->convert( 'wgs84' ); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | 1; |
|---|