Use the <size> tag to indicate the width and height of the overlay image based on the screen size. For more information, see the entry for <size>.
时间
Time can be attached to all features in KML. Currently, time cannot be authored in the Google Earth client itself, but must be authored directly in KML. When the time
feature is enabled (feature only available in the Google Earth EC client) all time-stamped features in a KML document can be made visible or hidden according to a
number of adjustable parameters in the Google Earth EC client time user interface. For example, polygons representing each state of the United States can have a time
value applied to represent the year the state joined the Union. Playback can be set in the Google Earth client to visually display the addition of each state.
For more information, see the entries for <timePosition>, <TimeInstant>, and <TimePeriod>.
样式
Similar to styles in HTML, styles can be employed in KML to define the appearance of geometry, icons, and labels in the viewer. Styles can be used for the following
effects:
Individual icons for normal, highlighted, and blinking states
Icon styling
Label styling
Line styling
Polygon styling
Style Selectors
You can use a <styleUrl> tag to reference a style selector. A style selector selects a specific style from a group of styles, and may be used to apply that style to any
piece of geometry. There are three style selector types in KML:
Style
A <Style> tag is used to indicate drawing style for icons, labels, lines and polygons. A <Style> tag is a style selector that selects itself. See the entry for <Style> for
more information.
StyleMap
A <StyleMap> tag is used to provide a second level of style referencing for such features as placemarks. It selects a style based on the placemark highlight state. See
the entry for <StyleMap> for more information.
StyleBlinker
A <StyleBlinker> tag can be used to reference custom icons so that they blink in the viewer. It selects a style based on time. The frequency and duration of the blinking is
customizable.
Important: All style selectors must have an "id", the XML attribute, in order to be accessible.
The following example shows how it is possible to implement a simple "rollover" icon change. Two style ids are defined-normal and highlighted-which are then mapped to
a styleUrl. The placemark has no local style, but instead is referenced to the global style.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<name>Simple Icon Rollover</name>
<open>1</open>
<Style id="normalPlacemark">
<IconStyle>
<Icon>
<href>C:/green_icon.jpg</href>
</Icon>
</IconStyle>
</Style>
<Style id="highlightPlacemark">
<IconStyle>
<Icon>
<href>C:/red_icon.jpg</href>
</Icon>
</IconStyle>
</Style>
<StyleMap id="exampleStyleMap">
<Pair>
<key>normal</key>
<styleUrl>#normalPlacemark</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#highlightPlacemark</styleUrl>
</Pair>
</StyleMap>
<Placemark>
<name>Example Placemark</name>
<styleUrl>#exampleStyleMap</styleUrl>
<Point>
<coordinates>-122.0856545755255,37.42243077405461,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
Schemas
For elements in your KML that are not native to the default KML schema, you can define your own schema as a set of named and typed XML elements. For example, you
can specify how KML should interpret imported files such as from a GPS tracker. A schema requires the following:
Parent entity
The KML entity that the new schema will inherit from. For example, if you want the data in your KML document to inherit the elements of a placemark, you would set
Placemark as the parent. See the entry for <parent> for more information.
Schema name
Google Earth KML中文说明 ---- Google Earth KML Docume... http://www.step1.cn/googleapi/map/kml.htm
第5页 共26页 2011-10-10 14:44