You are here

function kml_format_networklink in KML 5

Same name and namespace in other branches
  1. 6 kml.module \kml_format_networklink()

A generic function for generating a KML (Keyhole Markup Language for Google Earth) Network Link.

Arbitrary elements may be added using the $args associative array.

1 call to kml_format_networklink()
kml_networklink in ./kml.module
A function for creating a KML Network Link for a specific KML feed.

File

./kml.module, line 1050
KML Module

Code

function kml_format_networklink($title, $kml_feed, $url_items = array(), $args = array()) {
  $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
  $output .= "<kml xmlns=\"http://earth.google.com/kml/2.0\">\n";
  $output .= " <Document>\n";
  $output .= "  <NetworkLink>\n";
  $output .= "   <Url>\n";
  foreach ($url_items as $url_item => $value) {
    $output .= '    <' . $url_item . '>' . check_plain($value) . '</' . $url_item . ">\n";
  }
  $output .= "   </Url>\n";
  $output .= "  </NetworkLink>\n";
  $output .= " </Document>\n";
  $output .= "</kml>\n";
  return $output;
}