/** * @dataProvider latLongValueProvider */ public function testGivenLatLongInConstructor_getCoordinatesReturnsIt(LatLongValue $latLong) { $location = new Location($latLong); $this->assertTrue($latLong->equals($location->getCoordinates())); }
/** * 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; }