Stay organized with collections
Save and categorize content based on your preferences.
To incrementally modify data loaded over a NetworkLink, use the Update element, which is a child of NetworkLinkControl. Update can contain any number of Change, Create, and Delete elements, which are processed in order.
The figure below illustrates the sequence of events.
A NetworkLink loads the "original" KML file into Google Earth. An element that will later be updated needs to have an explicit id defined when it is first specified. The ids must be unique within a given file.
Another NetworkLink loads a second KML file containing the updates (any combination of Change, Create, and Delete) to the KML object(s) that have already been loaded. The update file contains two references to identify the original KML data:
To locate the objects within Google Earth, the Update element uses the targetHref element to identify the original file that defined the object(s) to be modified. To identify the object(s) to be modified or the container for new objects, the Change, Create, and Delete elements contain a targetId attribute that references the ids of those objects.
Change Example
The following example shows a set of sample NetworkLinks and KML data files. To run the sample:
Load the Point-load.kml file into Google Earth. This file contains the NetworkLink that loads the original data file, which contains two points (Point.kml).
Load the Update-load.kml file into Google Earth. This file contains the second NetworkLink, which loads the file containing the Update data (a new name for point123).
The first file contains the NetworkLink that loads the data file, which contains two points. The Placemarks that contain these points have ids assigned to them. The third file contains another NetworkLink, which adds the Update file. The Change element modifies the name of the Placemark for point123.
Here are the four files used in this example. First, this is the Point-load.kml file, which contains the NetworkLink that loads the original data file (Point.kml).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-03 UTC."],[[["\u003cp\u003eTo incrementally modify KML data loaded via NetworkLink, use the \u003ccode\u003eUpdate\u003c/code\u003e element within \u003ccode\u003eNetworkLinkControl\u003c/code\u003e containing \u003ccode\u003eChange\u003c/code\u003e, \u003ccode\u003eCreate\u003c/code\u003e, and \u003ccode\u003eDelete\u003c/code\u003e elements.\u003c/p\u003e\n"],["\u003cp\u003eObjects to be updated need a unique \u003ccode\u003eid\u003c/code\u003e attribute defined in the original KML file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUpdate\u003c/code\u003e element uses \u003ccode\u003etargetHref\u003c/code\u003e to locate the original KML file and \u003ccode\u003etargetId\u003c/code\u003e within \u003ccode\u003eChange\u003c/code\u003e, \u003ccode\u003eCreate\u003c/code\u003e, and \u003ccode\u003eDelete\u003c/code\u003e to identify specific objects.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eChange\u003c/code\u003e element allows modifying existing KML features like changing the name of a Placemark while retaining other properties.\u003c/p\u003e\n"]]],[],null,["To incrementally modify data loaded over a NetworkLink, use the Update element, which is a child of NetworkLinkControl. Update can contain any number of Change, Create, and Delete elements, which are processed in order.\n\nThe figure below illustrates the sequence of events.\n\n1. A NetworkLink loads the \"original\" KML file into Google Earth. An element that will later be updated needs to have an explicit *id* defined when it is first specified. The *ids* must be unique within a given file.\n2. Another NetworkLink loads a second KML file containing the updates (any combination of Change, Create, and Delete) to the KML object(s) that have already been loaded. The update file contains two references to identify the original KML data:\n3. To locate the objects within Google Earth, the Update element uses the *targetHref* element to identify the original file that defined the object(s) to be modified. To identify the object(s) to be modified or the container for new objects, the Change, Create, and Delete elements contain a *targetId* attribute that references the *ids* of those objects.\n\nChange Example\n\nThe following example shows a set of sample NetworkLinks and KML data files. To run the sample:\n\n1. Load the *[Point-load.kml](/static/kml/documentation/Point-load.kml)* file into Google Earth. This file contains the NetworkLink that loads the original data file, which contains two points (*Point.kml*).\n2. Load the *[Update-load.kml](/static/kml/documentation/Update-load.kml)* file into Google Earth. This file contains the second NetworkLink, which loads the file containing the Update data (a new name for *point123*).\n\nThe first file contains the NetworkLink that loads the data file, which contains two points. The Placemarks that contain these points have ids assigned to them. The third file contains another NetworkLink, which adds the Update file. The Change element modifies the name of the Placemark for *point123*.\n\nHere are the four files used in this example. First, this is the *Point-load.kml* file, which contains the NetworkLink that loads the original data file (*Point.kml*). \n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ckml xmlns=\"http://www.opengis.net/kml/2.2\"\u003e\n\u003cNetworkLink\u003e\n \u003cname\u003eLoads Point.kml\u003c/name\u003e\n \u003cLink\u003e\n \u003chref\u003ehttp://developers.google.com/kml/documentation/Point.kml\u003c/href\u003e\n \u003c/Link\u003e\n\u003c/NetworkLink\u003e\n\u003c/kml\u003e\n```\n\nHere is the *Point.kml* file, which contains the original data (two points). The point with the id \"point123\" is the point we will be modifying. \n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ckml xmlns=\"http://www.opengis.net/kml/2.2\"\u003e\n\u003cDocument\u003e\n \u003cPlacemark id=\"pm123\"\u003e\n \u003cname\u003epoint123\u003c/name\u003e\n \u003cPoint\u003e\n \u003ccoordinates\u003e-95.44,40.42,0\u003c/coordinates\u003e\n \u003c/Point\u003e\n \u003c/Placemark\u003e\n \u003cPlacemark id=\"pm456\"\u003e\n \u003cname\u003epoint456\u003c/name\u003e\n\t \u003cPoint\u003e\n \u003ccoordinates\u003e-95.43,40.42,0\u003c/coordinates\u003e\n \u003c/Point\u003e\n \u003c/Placemark\u003e\n\u003c/Document\u003e\n\u003c/kml\u003e\n```\n\nNext is the second NetworkLink file (*Update-load.kml*). This file loads the file that contains the Update information. \n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ckml xmlns=\"http://www.opengis.net/kml/2.2\"\u003e\n\u003cNetworkLink\u003e\n \u003cname\u003eUpdate\u003c/name\u003e\n \u003cLink\u003e\n \u003chref\u003ehttp://developers.google.com/kml/documentation/NetworkLinkControl-Update.kml\u003c/href\u003e\u003c/Link\u003e\n\u003c/NetworkLink\u003e\n\u003c/kml\u003e\n```\n\nAnd finally, here is the KML file *(NetworkLinkControl-Update.kml*) that contains the Update information: \n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ckml xmlns=\"http://www.opengis.net/kml/2.2\"\u003e\n\u003cNetworkLinkControl\u003e\n \u003cUpdate\u003e\n \u003ctargetHref\u003ehttp://developers.google.com/kml/documentation/Point.kml\u003c/targetHref\u003e\n \u003cChange\u003e\n \u003cPlacemark targetId=\"pm123\"\u003e\n \u003cname\u003eName changed by Update Change\u003c/name\u003e\n \u003c!-- coordinates remain the same --\u003e\n \u003c/Placemark\u003e\n \u003c/Change\u003e\n \u003c/Update\u003e\n\u003c/NetworkLinkControl\u003e\n\u003c/kml\u003e\n```\n\n[Back to top](#top)"]]