Exemplo n.º 1
0
 public static function getBody($dataObj)
 {
     self::$definition = $dataObj->definition;
     // Build the body
     // KML header
     $body = '<?xml version="1.0" encoding="UTF-8" ?>';
     $body .= '<kml xmlns="http://www.opengis.net/kml/2.2">';
     // Add the document
     $body .= self::getPlacemarks($dataObj);
     // Close tags
     $body .= "</kml>";
     return $body;
 }
Exemplo n.º 2
0
 public static function getBody($dataObj)
 {
     // Check if the original data is not GeoJSON
     if ($dataObj->source_definition['type'] == 'XML' && !empty($dataObj->geo_formatted) && $dataObj->geo_formatted) {
         return $dataObj->data;
     }
     self::$definition = $dataObj->definition;
     self::$map_property = $dataObj->source_definition['map_property'];
     // Build the body
     // KML header
     $body = '<?xml version="1.0" encoding="UTF-8" ?>';
     $body .= '<kml xmlns="http://www.opengis.net/kml/2.2">';
     // Add the document
     $body .= self::getPlacemarks($dataObj);
     // Close tags
     $body .= "</kml>";
     return $body;
 }