element in to rotate the model so that it points toward the front. If the model is not upright, try modifying the or elements.
Custom data elements defined in a earlier in the KML file.
It's often useful to add extended data associated with each time/position on a track. Bicycle rides, for example, could include data for heart rate, cadence, and power, as shown in Example of Track with Extended Data. In the , you define a for each custom data type. Then, for each data type, include a element containing elements that correspond to each time/position on the track. See the Adding Custom Data chapter of the KML Developer's Guide for more information on adding new data fields. In Google Earth, custom data is displayed in the Elevation Profile for the track.
Simple Example
This very basic example shows how to create parallel "arrays" of values for and . The number of time and position values must be equal.
xmlns:gx="http://www.google.com/kml/ext/2.2">
2010-05-28T02:02:09Z
2010-05-28T02:02:35Z
2010-05-28T02:02:44Z
2010-05-28T02:02:53Z
2010-05-28T02:02:54Z
2010-05-28T02:02:55Z
2010-05-28T02:02:56Z
-122.207881 37.371915 156.000000
-122.205712 37.373288 152.000000
-122.204678 37.373939 147.000000
-122.203572 37.374630 142.199997
-122.203451 37.374706 141.800003
-122.203329 37.374780 141.199997
-122.203207 37.374857 140.199997
Example of Track with Extended Data
The boldface type in this example highlights the elements used to define and specify custom data for a bike ride. The custom data fields are internally named "heartrate," "cadence," and "power." The element defines the name to display for each set of values (Heart Rate, Cadence, and Power) and specifies the data type for each new field (heartrate and cadence are of type int, and power is of type float). In Google Earth, this custom data is shown with the elevation profile for the track.
This example is a more realistic presentation of a track, with custom icons and separate icon and line styles for highlight and normal modes. Note, however, that the example includes only seven sets of data values. The actual example includes tens of thousands of values. (Data courtesy of Sean Broeder. This data was collected with a Garmin Edge 705 with associated heart rate monitor and power meter.)
GPS device
Created Wed Jun 2 15:33:39 2010
2010-05-28T02:02:09Z
2010-05-28T02:02:56Z
-122.205544
37.373386
1300.000000
normal
#track_n
highlight
#track_h
normal
#multiTrack_n
highlight
#multiTrack_h
normal
#waypoint_n
highlight
#waypoint_h
Heart Rate
Cadence
Power
Tracks
2010-05-28T01:16:35.000Z
#multiTrack
2010-05-28T02:02:09Z
2010-05-28T02:02:35Z
2010-05-28T02:02:44Z
2010-05-28T02:02:53Z
2010-05-28T02:02:54Z
2010-05-28T02:02:55Z
2010-05-28T02:02:56Z
-122.207881 37.371915 156.000000
-122.205712 37.373288 152.000000
-122.204678 37.373939 147.000000
-122.203572 37.374630 142.199997
-122.203451 37.374706 141.800003
-122.203329 37.374780 141.199997
-122.203207 37.374857 140.199997
86
103
108
113
113
113
113
181
177
175
173
173
173
173
327.0
177.0
179.0
162.0
166.0
177.0
183.0
Extends
Contained By
Syntax
...
...
...
...
Description
Specifies an addition, change, or deletion to KML data that has already been loaded using the specified URL. The specifies the .kml or .kmz file whose data (within Google Earth) is to be modified. is always contained in a NetworkLinkControl. Furthermore, the file containing the NetworkLinkControl must have been loaded by a NetworkLink. See the "Topics in KML" page on Updates for a detailed example of how Update works.
Elements Specific to Update
Can contain any number of , , and elements, which will be processed in order.
(required)
A URL that specifies the .kml or .kmz file whose data (within Google Earth) is to be modified by an element. This KML file must already have been loaded via a . In that file, the element to be modified must already have an explicit id attribute defined for it.
Modifies the values in an element that has already been loaded with a . Within the Change element, the child to be modified must include a targetId attribute that references the original element's id.
This update can be considered a "sparse update": in the modified element, only the values listed in are replaced; all other values remained untouched. When is applied to a set of coordinates, the new coordinates replace the current coordinates.
Children of this element are the element(s) to be modified, which are identified by the targetId attribute.
Adds new elements to a Folder or Document that has already been loaded via a . The element in specifies the URL of the .kml or .kmz file that contained the original Folder or Document. Within that file, the Folder or Document that is to contain the new data must already have an explicit id defined for it. This id is referenced as the targetId attribute of the Folder or Document within that contains the element to be added.
Once an object has been created and loaded into Google Earth, it takes on the URL of the original parent Document of Folder. To perform subsequent updates to objects added with this Update/Create mechanism, set to the URL of the original Document or Folder (not the URL of the file that loaded the intervening updates).
Deletes features from a complex element that has already been loaded via a . The element in specifies the .kml or .kmz file containing the data to be deleted. Within that file, the element to be deleted must already have an explicit id defined for it. The element references this id in the targetId attribute.
Child elements for , which are the only elements that can be deleted, are Document, Folder, GroundOverlay, Placemark, and ScreenOverlay.
Example of
http://www/
sam/January14Data/Point.kml
-95.48,40.43,0
Example of
This example creates a new Placemark in a previously created Document that has an id of "region24." Note that if you want to make subsequent updates to "placemark891," you will still use http://myserver.com/Point.kml as the .
http://myserver.com/Point.kml
-95.48,40.43,0
Example of
This example deletes a Placemark previously loaded into Google Earth. (This Placemark may have been loaded directly by a NetworkLink with the specified URL, or it may have been loaded by a subsequent Update to the original Document.)
http://www.foo.com/Point.kml
Contained By
Note: This element was deprecated in KML Release 2.1 and is replaced by , which provides the additional functionality of Regions. The tag will still work in Google Earth, but use of the newer tag is encouraged.
Use this element to set the location of the link to the KML file, to define the refresh options for the server and viewer changes, and to populate a variable to return useful client information to the server.
KML-файлы содержат геоинформационные данные объектов, отображаемых в таких продуктах, как Google Планета Земля, Google Карты и Google Карты для мобильных устройств.
Обновлено 2 янв. 2014 г.
Руководство разработчика
KML-файлы содержат геоинформационные данные объектов, отображаемых в таких продуктах, как Google Планета Земля, Google Карты и Google Карты для мобильных устройств.
Обновлено 2 янв. 2014 г.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-08-19 UTC. Blog
Read the latest updates and tips. Twitter
Follow us on Twitter. Connect Blog
Facebook
Medium
Twitter
YouTube
Programs Women Techmakers
Google Developer Groups
Google Developers Experts
Accelerators
Google Developer Student Clubs
Developer consoles Google API Console
Консоль облачной платформы Google
Консоль Google Play
Консоль Firebase
Действия в консоли Google
Консоль разработчика Cast SDK
Панель управления Интернет-магазина Chrome
Андроид
Хром
Firebase
Облачная платформа Google
Все продукты Условия
Конфиденциальность
Подпишитесь на рассылку новостей Google DevelopersПодписывайся
Русский
Исходный текст
has a maxLines attribute, an integer that specifies the maximum number of lines to display.