+ # http://developer.emnet.ne.jp/browser3-1.html
+ # Example:
+ # http://www.emobilemap.net/positioning.cgi?ver=MOPA-001-2001&pos=N35.44.33.156E135.22.33.124&geo=wgs84&x-acy=1
+ if($ci->is_emobile()){
+ unless(defined $h{pos}) {
+ $p->{error} = 1;
+ $p->{error_lcs} = 1;
+ return $view->render('location_receiver.html', $p);
+ }
+
+ my ($wx, $wy);
+ if($h{pos} =~ /N([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)E([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/){
+ ($wx, $wy) = ($1, $2);
+ }
+
+ ($wx, $wy) = (dms_to_degree($wx), dms_to_degree($wy));
+ my ($tx, $ty) = wgs84_to_tokyo($wx, $wy);
+ my $xml_code = get_rgeocode_xml($wx, $wy);
+ unless($xml_code){
+ $p->{error} = 1;
+ $p->{rgeocode_noresponse} = 1;
+ return $view->render('location_receiver.html', $p);
+ }
+
+ my $xml = XMLin($xml_code);
+ if($xml->{status} ne 'true'){
+ $p->{error} = 1;
+ $p->{rgeocode_invalid} = 1;
+ return $view->render('location_receiver.html', $p);
+ }
+ $p->{wx} = $wx;
+ $p->{wy} = $wy;
+ $p->{tx} = $tx;
+ $p->{ty} = $ty;
+ $p->{map_image_url} = google_map_image($wx, $wy, 'gif');
+ $p->{address} = $xml->{prefecture}->{pname} .
+ $xml->{municipality}->{mname} .
+ $xml->{local}->{section};
+ Encode::_utf8_off($p->{address}) if Encode::is_utf8($p->{address});
+ Encode::from_to($p->{address}, 'utf8', 'shiftjis');
+ return $view->render('location_receiver.html', $p);
+ }
+