Esempio n. 1
0
 private function createAddPresenter($template, $childWpHandler, $cacheId)
 {
     $presenter = new ChildWp_AddPresenter($this->request, $this->translator);
     /* set default waypoint coordinates to cache coordinates */
     $presenter->initCoordinate(Coordinate_Coordinate::getFromCache($cacheId));
     return $presenter;
 }
Esempio n. 2
0
 public function getCoordinate()
 {
     return Coordinate_Coordinate::fromHemDegMin($this->getLatHem(), $this->getLatDeg(), $this->getLatMin(), $this->getLonHem(), $this->getLonDeg(), $this->getLonMin());
 }
 function testFormatHtmlSeparator()
 {
     $formatter = new Coordinate_Formatter();
     $this->assertIdentical('N 10° 20.000\' E 030° 40.000\'', $formatter->formatHtml(Coordinate_Coordinate::fromHemDegMin(true, 10, 20, true, 30, 40), ' '));
     $this->assertIdentical('S 15&deg; 25.000\'<br/>W 035&deg; 45.000\'', $formatter->formatHtml(Coordinate_Coordinate::fromHemDegMin(false, 15, 25, false, 35, 45), '<br/>'));
 }
 function testEqauls2()
 {
     $coordinate1 = new Coordinate_Coordinate(0.1, 2);
     $coordinate2 = new Coordinate_Coordinate(-0.1, 2);
     $this->assertNotEqual($coordinate1, $coordinate2);
     $this->assertEqual($coordinate1, Coordinate_Coordinate::fromHemDegMin($coordinate1->latHem(), $coordinate1->latDeg(), $coordinate1->latMin(), $coordinate1->lonHem(), $coordinate1->lonDeg(), $coordinate1->lonMin()));
     $this->assertEqual($coordinate2, Coordinate_Coordinate::fromHemDegMin($coordinate2->latHem(), $coordinate2->latDeg(), $coordinate2->latMin(), $coordinate2->lonHem(), $coordinate2->lonDeg(), $coordinate2->lonMin()));
 }