Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/50492
Change subject: (bug 45310) Fix call to undefined method Maps\Location::getLongitude ...................................................................... (bug 45310) Fix call to undefined method Maps\Location::getLongitude Change-Id: I7d9a4297b2b96ad6dfbcd461790bb221f7d7efc3 --- M includes/Maps_KMLFormatter.php 1 file changed, 14 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Maps refs/changes/92/50492/1 diff --git a/includes/Maps_KMLFormatter.php b/includes/Maps_KMLFormatter.php index 06145e1..b3afddf 100644 --- a/includes/Maps_KMLFormatter.php +++ b/includes/Maps_KMLFormatter.php @@ -1,5 +1,8 @@ <?php +use \Maps\Location; +use DataValues\GeoCoordinateValue; + /** * Class to format geographical data to KML. * @@ -23,7 +26,7 @@ /** * @since 0.7.3 * - * @var array of \Maps\Location + * @var Location[] */ protected $placemarks; @@ -65,9 +68,9 @@ * * @since 0.7.3 * - * @param \Maps\Location $placemark + * @param Location $placemark */ - public function addPlacemark( \Maps\Location $placemark ) { + public function addPlacemark( Location $placemark ) { $this->placemarks[] = $placemark; } @@ -76,7 +79,7 @@ * * @since 0.7.3 * - * @param array of \Maps\Location $placemark + * @param Location[] $placemarks */ public function addPlacemarks( array $placemarks ) { foreach ( $placemarks as $placemark ) { @@ -140,20 +143,22 @@ * * @since 0.7.3 * - * @param \Maps\Location $location - * + * @param Location $location + * * @return string */ - protected function getKMLForLocation( \Maps\Location $location ) { + 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(), - $location->getLongitude() . ',' . $location->getLatitude() . ',' . $location->getAltitude() + $coordinates->getLongitude() . ',' . $coordinates->getLatitude() . ',' . $coordinates->getAltitude() ); return <<<EOT -- To view, visit https://gerrit.wikimedia.org/r/50492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d9a4297b2b96ad6dfbcd461790bb221f7d7efc3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Maps Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits