Search code examples
automationkmlgoogle-earth

Add multiple KML files automatically into Google Earth from a folder for the whole of the Business


Im looking to add multiple KML files automatically into Google Earth from a folder for the whole of the Business. Basically once someone within the Business opens google earth they will automatically see all the KML files that have been stored in a particular folder we have setup.

I have searched Google but there really isn't any clear answers.


Solution

  • Google Earth doesn't automatically load from a directory of KML files at startup but you still have some options.

    You could create a master KML document with a Networklink with a reference to each of the KML files in your folder. One NetworkLink is needed for each KML file. You can then save that master KML document to your saved places which is loaded at startup.

    Example:

    <kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
      <NetworkLink>
        <name>file1</name>
        <Link>folder/file1.kml</Link>
      </NetworkLink>
      <NetworkLink>
        <name>file2</name>
        <Link>folder/file2.kml</Link>
      </NetworkLink>
      ...
    </Document>
    </kml>
    

    If the names or number of files changes often then you may need a static master KML document (saved in your "My Places") that points to a secondary master KML that is automatically created when the files change.