Example #1
0
    /**
     * Returns the KML representing the provided location.
     * 
     * @since 0.7.3
     * 
     * @param MapsLocation $location
     * 
     * @return string
     */
    protected function getKMLForLocation(MapsLocation $location)
    {
        $name = '<name><![CDATA[ ' . $location->getTitle() . ']]></name>';
        $description = '<description><![CDATA[ ' . $location->getText() . ']]></description>';
        // lon,lat[,alt]
        $coordinates = Xml::element('coordinates', array(), $location->getLongitude() . ',' . $location->getLatitude() . ',' . $location->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;
    }