function testFormatLatitudeMinute()
 {
     $formatter = new Coordinate_Formatter();
     $this->assertIdentical('00.000', $formatter->formatLatMin(Coordinate_Coordinate::fromHemDegMin(true, 1, 0, true, 0, 0)));
     $this->assertIdentical('00.001', $formatter->formatLatMin(Coordinate_Coordinate::fromHemDegMin(true, 1, 0.001, true, 0, 0)));
     $this->assertIdentical('01.000', $formatter->formatLatMin(Coordinate_Coordinate::fromHemDegMin(true, 1, 1, true, 0, 0)));
     $this->assertIdentical('10.000', $formatter->formatLatMin(Coordinate_Coordinate::fromHemDegMin(true, 1, 10, true, 0, 0)));
     $this->assertIdentical('59.999', $formatter->formatLatMin(Coordinate_Coordinate::fromHemDegMin(true, 1, 59.999, true, 0, 0)));
 }
Exemple #2
0
 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'));
     }
 }