diff --git a/classes/Kml.php b/classes/Kml.php index 83171e2..dce51b2 100644 --- a/classes/Kml.php +++ b/classes/Kml.php @@ -17,11 +17,12 @@ class Kml foreach ($this->get($this->kml, 'Placemark') as $placemark) { if ($this->has($placemark, 'Point')) { + $latlngs = $this->getCoords($placemark); $this->waypoints[] = array( 'name' => trim($this->getValue($placemark, 'name')), 'description' => trim($this->getValue($placemark, 'description')), 'when' => date('c', strtotime($this->getValue($placemark, 'when'))), - 'latlng' => $this->getCoords($placemark)[0], + 'latlng' => $latlngs[0], ); }