Show
Ignore:
Timestamp:
12/06/07 18:55:16 (5 years ago)
Author:
clouder
Message:

lang/perl/HTTP-MobileAgent?-Plugin-Locator: modifiled to apply Apache::Request and CGI instance, and return G::C::C::Point instance

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAgent-Plugin-Locator/trunk/lib/HTTP/MobileAgent/Plugin/Locator/SoftBank/BasicLocation.pm

    r2437 r2652  
    11package HTTP::MobileAgent::Plugin::Locator::SoftBank::BasicLocation; 
    2 # 簡易位置情報 
     2# Simple Location Information 
    33 
    44use strict; 
    5 use base qw( HTTP::MobileAgent::Plugin::Locator::Base ); 
     5use base qw( HTTP::MobileAgent::Plugin::Locator ); 
     6use Geo::Coordinates::Converter; 
    67 
    78sub get_location { 
    8     my ( $self, $page ) = @_; 
     9    my $self = shift; 
    910    my $geocode = $ENV{ HTTP_X_JPHONE_GEOCODE }; 
    1011    $geocode =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; 
    1112    my ( $lat, $lng, $address ) = split /\x1a/, $geocode; 
    12     return +{ 
    13         lat => _convert_point( $lat ) || undef, 
    14         lng => _convert_point( $lng ) || undef, 
    15     }; 
     13    return Geo::Coordinates::Converter->new( 
     14        lat   => _convert_point( $lat ) || undef, 
     15        lng   => _convert_point( $lng ) || undef, 
     16        datum => 'tokyo', 
     17    )->convert( 'wgs84' ); 
    1618} 
    1719