コード例 #1
0
ファイル: Presenter.php プロジェクト: RH-Code/opencaching
 public function prepare($template)
 {
     $formatter = new Coordinate_Formatter();
     $coordinate = $this->getCoordinate();
     $template->assign(self::lat_hem, $formatter->formatLatHem($coordinate));
     $template->assign(self::lat_deg, $formatter->formatLatDeg($coordinate));
     $template->assign(self::lat_min, $formatter->formatLatMin($coordinate));
     $template->assign(self::lon_hem, $formatter->formatLonHem($coordinate));
     $template->assign(self::lon_deg, $formatter->formatLonDeg($coordinate));
     $template->assign(self::lon_min, $formatter->formatLonMin($coordinate));
     if (!$this->valid) {
         $template->assign(self::coord_error, $this->translator->translate('Invalid coordinate'));
     }
 }
コード例 #2
0
 function testFormatWestHemisphere()
 {
     $formatter = new Coordinate_Formatter();
     $this->assertEqual('W', $formatter->formatLonHem(new Coordinate_Coordinate(1, -2)));
 }