コード例 #1
0
ファイル: LocationTest.php プロジェクト: gwdgithubnom/Maps
 /**
  * @dataProvider latLongValueProvider
  */
 public function testGivenLatLongInConstructor_getCoordinatesReturnsIt(LatLongValue $latLong)
 {
     $location = new Location($latLong);
     $this->assertTrue($latLong->equals($location->getCoordinates()));
 }
コード例 #2
0
ファイル: Maps_KMLFormatter.php プロジェクト: whysasse/kmwiki
    /**
     * Returns the KML representing the provided location.
     * 
     * @since 0.7.3
     * 
     * @param Location $location
     *
     * @return string
     */
    protected function getKMLForLocation(Location $location)
    {
        $name = '<name><![CDATA[ ' . $location->getTitle() . ']]></name>';
        $description = '<description><![CDATA[ ' . $location->getText() . ']]></description>';
        $coordinates = $location->getCoordinates();
        // lon,lat[,alt]
        $coordinates = Xml::element('coordinates', array(), $coordinates->getLongitude() . ',' . $coordinates->getLatitude() . ',' . $coordinates->getAltitude());
        return <<<EOT
\t\t<Placemark>
\t\t\t{$name}
\t\t\t{$description}
\t\t\t<Point>
\t\t\t\t{$coordinates}
\t\t\t</Point>
\t\t</Placemark>
\t\t
EOT;
    }