|
管理员
  
|
1#
大 中
小 发表于 2007-10-31 23:14 只看该作者
解读Google Earth KML
基于Google Earth客户端版本3.0 的KML 版本2.0
本文来源于Google,由Step1.cn翻译
KML 2.0介绍
KML全称是Keyhole Markup Language KML,是一个基于XML语法和文件格式的文件,用来描述和保存地理信息如点、线、图片、折线并在Google Earth客户端之中显示, (KML以前的版本能够被Google Earth读取并保存为KML 2.0) KML 2.0提供以下功能:
? 指定一个地点的图标和标注来区分每一个地点
? 为每一个视图指定明确的视角来创建不同的特写镜头
? 使用指定到屏幕或地理位置的图片标注
? 为特定种类的标注定义显示样式
? 为标注指定基于简单HTML语法的描述,支持超级链接和图片的显示
? 使用目录(folders)对标注进行树形的分类管理(为了便于理解和符合习惯,将"folder"翻译为"目录",实际上是代表一组地理标注,请谅解)
? 基于时间戳记的标注可以用来进行动态的播放
? 从本地或远程的网络地址动态的加载KML文件
? 当Google Earth客户端视图变化时,自动将视图信息发送给指定的源服务器并从服务器获取相关的标注信息
KML被Google Earth viewer显示的过程和HTML网页被浏览器处理差不多,而且和HTML一样,KML也使用一种基于标签(名称和属性)的语法格式来描述地里标注信息,可以说,Google Earth viewer是一个KML文件浏览器.
目录
? KML 2.0 What's New
? 编写您自己的Google earth KML文件
? KML基础
o 常用标签
o 地名标注(Placemarks)
o 几何图形(Geometry)
o 目录(Folders)
o 文档(Documents)
o 图片标注(Image Overlays)
? 地理图片标注(Ground Overlays)
? 屏幕图片标注(Screen Overlays)
o 时间
o 样式
o Schemas
o 网络连接
o Google Earth KML 2.0参考
? KML语法规则
? 文档结构
? 标记类型
? 字符串
? KML标签列表
? <address>
? <altitudeMode>
? <begin>
? <color>
? <coordinates>
? <description>
? <Document>
? <drawOrder>
? <east>
? <end>
? <extrude>
? <fill>
? <Folder>
? <geomColor>
? <GeometryCollection>
? <geomScale>
? <GroundOverlay>
? <h>
? <heading>
? <href>
? <Icon>
? <IconStyle>
? <innerBoundaryIs>
? <labelColor>
? <latitude>
? <LatLonBox>
? <LinearRing>
? <LineString>
? <longitude>
? <LookAt>
? <name>
? <NetworkLink>
? <north>
? <ObjArrayField>
? <ObjField>
? <open>
? <outerBoundaryIs>
? <outline>
? <overlayXY>
? <Pair>
? <parent>
? <Placemark>
? <Point>
? <Polygon>
? <PolyStyle>
? <range>
? <refreshInterval>
? <refreshVisibility>
? <rotation>
? <Schema>
? <scale>
? <ScreenOverlay>
? <screenXY>
? <SimpleArrayField>
? <SimpleField>
? <size>
? <south>
? <snippet>
? <Style>
? <StyleMap>
? <styleUrl>
? <tessellate>
? <tilt>
? <TimePeriod>
? <TimeInstant>
? <timePosition>
? <type>
? <href>
? <Url>
? <viewRefreshMode>
? <viewRefreshTime>
? <visibility>
? <w>
? <west>
? <x>
? <y>
KML 2.0 更新
KML 1.0是由原先的Keyhole客户端进行读写的文件格式,Google Earth完全支持KML 1.0文件,KML 2.0 是KML 1.0的升级版本,主要的更新如下:
o Google Earth默认的输出文件格式改为KMZ,这是一个经过ZIP格式压缩过的KML文件,可以被任何支持ZIP压缩文件格式的软件打开,这种文件的优点是自身可以包含图片而不需要引用网络上的图片;
o <description>标签现在可以支持一些标准的HTML格式语法,例如链接、图片、带格式文本和表格;
o 过去使用的<View>标签被新的<LookAt>标签替代;
o 对<ScreenOverlay>标签的语法进行了升级更新;
o 样式功能更为强大,现在由<IconStyle>、 <LabelStyle>、 <LineStyle>和<PolyStyle>四个分样式组成;
o 过去的网络连接功能升级后能支持基于视图变化的更新;
o 线段可以选择是否根据地形进行自动调整;
o <opacity>标签不再支持,推荐使用<color>标签来实现透明;
o Network links功能现在支持向服务器发送当前视角信息,以便让服务器返回特定的KML文件。
编写您自己的Google earth KML文件
Google Earth中的所有标注都是通过KML来描述的,KML有以下撰写方式:
使用Google Earth client撰写KML文件:
对于希望创建通过E-mail或者网页来发布的不动态的KML文件的用户来说,Google Earth 客户端就是一个很好的KML撰写工具,在Google Earth客户端中简单的按照您自己的要求组织您需要的数据并保存成一个独立的文件即可,在开发人员想要测试复杂的KML文档结构的时候,这个功能也同样有用, Google Earth客户端能够创建和保存几乎所有的KML标签。
使用文本编辑器:
你可以使用一个文本编辑器来创建简单的KML文件,或者测试一个KML文件的结构和语法的有效性。
TIP: 想要快速的检查KML语法,在Google Earth中右键点击一个地名标注或者图片标注,然后在菜单中选择"Copy", 然后你可以打开一个简单的文本文档然后将KML内容粘贴到其中,就可以方便的查看Google Earth撰写的KML内容了
使用开发环境来自动生成KML文件:
您能够使用一种用来动态生成网页内容的编辑平台来生成KML地标文件,只要能够生成XML文件,就可以同样生成KML文件。
下面是一个KML文件范例:
<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
<description><![CDATA[<a href="http://www.google.com.honeycomb.cs.cornell.edu:8888/">Google Search!</a>]]></description>
<name>Google Headquarters</name>
<LookAt>
<longitude>-122.0839</longitude>
<latitude>37.4219</latitude>
<range>540.68</range>
<tilt>0</tilt>
<heading>3</heading>
</LookAt>
<Point>
<coordinates>-122.0839,37.4219,0</coordinates>
</Point>
</Placemark>
</kml>
这个文件里有一个<kml>标签,包含一个被命名为Google Headquarters的<Placemark>标签,当这个文件被Google Earth客户端读取的时候,<Placemark>将会以默认的图标和在<Point>中指定的经纬度处显示, <Placemark>的<LookAt>子标签指定当在Google Earth中显示这个标注的时候"照相机"视点.
你可以复制该范例内容并保存成扩展名为.kml的文本文件,在Google Earth之中打开查看效果
本文档的剩下部分还包含以下内容:
? 在你撰写你自己的KML文件的时候涉及到的Google Earth客户端 标签
? 程序员和GIS(地理信息系统)专业人员在用适当的方式撰写KML文件的时候需要的KML语法和指导
? KML语法参考,包括复合标签和单一标签
KML基础
Google Earth 客户端支持了大量的显示标签用来创建和保存成KML文档。如果你喜欢,你可以先用文本编辑器修改KML文档,然后在Google Earth客户端中打开看显示的效果,这和你修改一个HTML文档并在浏览器之中观看效果是一样的。对于更高级的程序,你可以使用CGI脚本生成KML文件,这一节讲解在Google Earth客户端之中支持的KML基本标签。
常用标签
在本节中描述的所有标注(目录folders,地名标注placemarks,图片标注overlays 和 网络连接)都包含以下元素.
<Name>
KML语法使用<name></name>标签来指定目录(floder)、地名标注(placemark)、图片标注(overlay)或其他标记的名称,以便在Google Earth中进行区别,下面的例子显示了<name>标签在<Folder>标签上的应用:
<Folder>
<name>My House</name>
.
.
.
</Folder>
<description>
使用描述元素给标注附加更多的关于该标注的信息,Google Earth自动识别其中的网址并显示为一个链接,并不需要任何HTML标记,不过你也可以再需要时使用HTML格式化文本的显示,甚至还可以使用图片。
为了在描述之中使用HTML标签,您需要使用CDATA XML 标签来避免XML对HTML字符的解析,或者您也可以对特定的字符进行实体引用
注意:在第一个测试版中在<img src="">标签中部允许包含GIF图片,这个错误将在下一版本中修正,不过现在您可能还是只能使用JPG, PNG or BMP这几种格式。
<visibility>
<visibility>用来设置标注在第一次被Google Earth打开时的默认显示属性. Visibility对所有的标注都有效。不过visibility在目录之中使用的时候存在特殊情况,一个标记只有在它和它所有的上级标签都设成true(1)的时候才会显示。
你可以定义该标注在用户打开KML文件的时候是否显示,在文件打开完成之后是否显示该标注完全取决于用户的操作。
<LookAt>
<LookAt>元素用来指定对给定点的特定视角,Google Earth能够为地名标注(placemarks),目录(folders),图片标注(overlays)和其他标注设置视角,当一个标注存在指定的<LookAt>标签时,双击该标注将使Google Earth平滑移动到指定视角。
值得注意的是,视角和标注的经纬度没有任何关系,例如,一个地名标注可能在一大片陆地的中央,而该标注对应的视角观察者却朝向陆地的左边边界。
实际上,一个标注的视点可能被设置到甚至根本看不到该标注本身的位置,因此当你为一个地名标注设置一个视点的时候,不要认为它会自动的让该标注出现在Google Earth视图之中。这样可能在你想为一个特定的标注使用一个特定的,不受限制的视角时非常有用,可有时候也会带来麻烦,因此,请谨慎使用本功能。当一个标记没有<LookAt>标签时,双击该标签将使Google Earth缩放当前视图到包含该标注点
<address>
你可以使用包含地址字符串的<Point>标签来代替指定经纬度,例如<address>1600 Amphitherter Pkwy, Mountain View, CA</address> 这样将使用Google Earth的功能来解析这个地址(请注意这个功能现在只支持美国地址)
<snippet>
<snippet>标签允许您插入多行的描述文本,当用户选中该标签的时候,这些文本将显示在窗口的底部。
地名标注<Placemark>
Placemarks are the primary means of marking a location on the earth.A plcaemark may contain a single point, linestring, polygon, or arbitrary collections of these features. User-defined styles may be created to control the appearance of each of these elements.
With KML, you can customize your placemark information in a variety of ways. In addition to the common elements, the placemark element uses a style reference (<styleUrl>) to specify the desired style for that placemark.
For example, you can use any image-such as your company logo-as the icon for a placemark by using the style reference to point to the desired icon. In addition, the style can reference a style map in order to display a different style when the user mouses over a placemark. In this way, you can have both a normal and a highlighted state for placemark icons. Finally, you can also use style references to set scale and color for geometry as well as point labels.
You can also specify a <Style> within a <Placemark>. This style is known as the Placemark's local style. Any fields that are specified in the local style will override the corresponding fields in the referenced style (i.e., any style referenced through <styleUrl>). Minimal use of local styles is recommended for best efficiency.
几何图形Geometry
The following types of geometry can be expressed in the Google Earth client viewer:
Point geometry
Points may be mapped on the earth's surface as either icons or labels, or both. Placemarked points may be richly annotated within the Google Earth client, and may be positioned three-dimensionally. Points positioned at altitude may also be extruded, creating a line that tethers the placemark to the ground.
Line geometry
This includes lines and linestrings (polylines), but not road data. As with points, lines may be positioned at altitude, and extruded to form solid walls.
Polygons
Two dimensional polygons may be created in the Google Earth client. As with lines, polygons may be positioned at altitude and extruded to form three-dimensional objects. Using a combination of points, lines, and polygons, it is easy to create rich, visually arresting displays of your data.
Collections
Lines and polygons may be grouped into collections.
Coordinates
Coordinate values for geometry must be entered in degrees (longitude, latitude) and meters (elevation above sea level). KML uses the <coordinates> tag to describe this feature. See the entry for <coordinates> for more information.
Important: The required geographic coordinates specification is Longitude, Latitude, and Altitude, in that order. If you don't follow this method, your coordinate specifications will be misinterpreted.
3D Geometry
In the Google Earth client it is possible to create three-dimensional shapes by extruding two-dimensional objects. See the entry for <extrude> for more information.
目录<Folder>
Most uses of KML employ folders to organize placemarks, screen and ground overlays, and other folders. Use folders to structure collections of features and overlay groups, andto provide a unified view for a group of placemarks and/or overlays. In addition to the common elements, folders may have a number of extra properties:
<open>
A switch (0 or 1) that controls whether or not the folder will be in an expanded or collapsed state when it is loaded.
Logical containment of related data, and folder nesting
You can use a folder to contain related placemarks, overlays, and other folders. By providing folders with a name and LookAt values, you can group information in way to make it easily identifiable and manageable. For example, you can use a folder to associate a placemark with a related overlay image file for a multi-layered view of a particular region.
You can create a hierarchical structure in a manner similar to the Microsoft Windows folder view, so that folders can be expanded or collapsed to reveal or hide content as needed. Do this in the Google Earth client by dragging and dropping folders on top of other folders in order to nest them. In KML, <Folder></Folder> tags simply nest within each other, in the same way that <table></table> tags can be nested in HTML.
文档<Document>
A document is a type of folder that can also contain the <Styles> and <Schemas> tags in addition to features such as placemarks, overlays and folders. Use documents to group styles and schemas for a collection. Documents are also often root-level containers of KML hierarchies.
Note: When you need to use styles or schema for your data, you must also use the <Document> element to contain these other elements. Use styles when you want to add custom icons and color and/or size information to geometry (see the entry for <Styles>). Use schemas when your data collection contains features that are not native to KML. With schemas, you can define a feature and its associated meta-data so that it is correctly displayed in the Google Earth client.
图片标注(Image Overlays)
Image overlays can be described in KML for adding image-based meta-data to your GIS data in the Google Earth client. There are two types of overlays:
地理图片标注<GroundOverlay>
Use ground overlays for information-rich site display such as phased plans or weather maps. Ground overlays are images that are fixed to the planet surface.
<ScreenOverlay>
A screen overlay is a "floating" image independent of the camera position and is fixed to the screen. Examples of screen overlays might include displaying a legend of key for the data, or perhaps copyright messages.
<drawOrder>
When using overlapping overlays, you can set the draw order to determine the overlay stacking order. In this way, for example, overlay images with black boundary edges or masked boundaries can be assigned a lower number than adjacent overlays so as not to obscure useful information.
<Icon>
The <Icon> tag references the overlay image file either locally or remotely, such as on your corporate web server. Remote users do not have to have a local copy of an overlay image if the image is supplied remotely. In this way, you can provide real-time updates of overlay data, such as weather, or development progress of site plans. The icon tag also contains child elements such as <refreshInterval>, which may be used to control automatic updates of remotely-served images (webcams, for example).
The following image types are supported:
o JPG
o PNG
o GIF
o TIFF
<rotation>
You can set the rotation of the overlay image. The image can be rotated up to 180 degrees in a clockwise (positive) or counter-clockwise (negative) rotation from north.
<GroundOverlay>
In KML, ground overlay tags can be placed inside any folder or subfolder in your KML document. In addition to the common elements, ground overlays support the following elements:
<north>, <south>, <east>, <west>
Four coordinates set the edges of the overlay. These coordinates set the North-South (latitude), East-West (longitude) positions of the overlay boundaries. In addition, you can indicate the overlay's rotation, which is about the center of the overlay. In the Google Earth client viewer, you can drag and rotate the overlay in order to set the coordinates, or you can enter in your own values.
屏幕图片标注<ScreenOverlay>
Use screen overlays to display information regardless of the camera position, such as heads up display, co-branding, or other types of dashboard display. As with ground overlays, you can define multiple screen overlays and associate them with a folder. You can define the position as an absolute coordinate position in the viewer, or as a percentage of the viewer size. You can also set the color of a screen overlay.
Note: Screen overlays can currently only be authored in KML using a text editor, not in the Google Earth client.
Screen overlays have the following features:
Screen position
Two mechanisms for screen positioning provide flexibility in different presentation formats. You can determine the position of the screen image using X/Y coordinates either with exact pixels, or as a fraction of the overall screen. See the entries for <overlayXY>, <screenXY> and <size> for more information.
<size>
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:
o Individual icons for normal, highlighted, and blinking states
o Icon styling
o Label styling
o Line styling
o 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
As with all other features, the name element identifies the schema. See the entry for <name> for more information.
Field declaration(s)
The field declaration specifies the individual fields in your KML data and defines their name and type. The following example illustrates:
<Schema>
<name>States</name>
<parent>Placemark</parent>
<SimpleField>
<name>FIPS</name>
<type>wstring</type>
</SimpleField>
<SimpleField>
<name>STATE</name>
<type>wstring</type>
</SimpleField>
</Schema>
Here, the schema inherits all the attributes of the Placemark element. It defines three simple fields -- FIPS, STATE, and NAME -- all of which are wide string fields (unicode UCS2 encoding). Subsequent use of those fields in the KML will be correctly interpreted by the Google Earth client as elements similar in structure to Placemark elements.
网络连接
Use network links to quickly and easily share KML files among multiple users by sharing a link to the data rather than distributing the data itself. In addition to the common features, a network link has the following features:
Icon
Containes the information associated with the linked KML file. Network links can reference the KML file either on remote servers (http://..) or on local networks (\myServer\..). The Url tag is a parent to several child tags which control various aspects of the link's behavior. These are:
href
网络文件的路径
刷新间隔
指定网络文件的刷新间隔,如果该值大于0,网址每隔n秒刷新一回,如果小于0,网址则不会被加载,如果等于0,则会只下载一次. 查看<refreshinterval>标签获取更多信息.
可见性刷新Refresh Visibility
指定在Google Earth中的项变化时是否重置该项的可见性.例如,假设有一项在KML文件之中可见性设置为0,而且refreshVisibility设置为1,当文件第一次加载到Google Earth之中的时候,该项是不显示的如果用户通过点击该项的复选框而已经使该项显示出来,这种情况下该网络KML文件被刷新之后,该项又会重新变成不显示. 查看<refreshvisibility>标签获取更多信息.
刷新模式
网络连接有三种动态加载方式:用户手动请求、文件被加载时,和周期性的刷新,查看<refreshmode>标签获取更多信息.
视图刷新模式
Google Earth能够向网络服务器发送基于视图的查询请求,这种请求可以是周期性(根据视图刷新时间的设置)的,也可以是当视图停顿一段时间后. 一旦触发后,Google Earth向服务器发送一个包含当前视图坐标的请求,服务器根据坐标返回相应的信息内容,查看<viewrefreshmode>标签获取更多信息.
视图刷新时间View Refresh Time
和刷新间隔差不多,但是该项的值控制试图坐标的值每隔多长时间发送到服务器,查看<viewRefreshTime>标签获取更多信息
注意: 当使用本地网络路径的时候,路径之中的分隔符应该使用(//)而不是(\).
Google Earth KML 2.0 参考
这一节包含KML标签的语法结构和参考信息.
KML语法规则
和任何程序和脚本语言一样,KML有一些必须遵循的语法规则.
文档结构
一个KML文档应该完全遵循KML格式,文档也和基本的XML语法规则差不多,有以下几点要特别注意的地方.
o XML标签必须关闭
o XML标签是大小写敏感的
o 对于KML语法,首字母大写的标签是复合标签,否则就是单一标签,在实体和标签介绍之中有更多相关信息.
o XML标签必须正确嵌套
o XML文档必须只有一个根标签
o 对于KML文件,这意味着你可以使用<kml></kml>, <Document></Document> <Folder></Folder>甚至 <Placemark></Placemark>作为根标签
o 属性必须用引号包围起来
o CR/LF(回车符)被认为是插入一个新行(在HTML描述之中,被转化为<br>)
o XML的注释方法和HTML是一样的
要了解更多信息,可以去查阅XML参考文档或语法向导.如果你的KML文档结构不符合XML文档规范,将会在Google Earth中产生一个解析错误的对话框 (查看http://www.w3.org/XML/ 了解根多关于XML的信息.)
注意: XML Schema 验证还没有被Google Earth支持.
标记类型
有两种基本的KML标记类型: 单一标签和复合标签.复合标签的标签名首字母是大写的,而单一标签都是小写的,复合标签能够作为其他标签(单一标签或复合标签)的父元素, ,而单一标签只能是其他复合标签的子元素,而自身不能包含其他元素.
字符串
在KML文件中的任何字符串,例如 name 和 description标签中的值,都可以是utf-8或者Unicode编码的字符串.
KML标签列表
这一节包含所有能用的KML标签的参考,按字母顺序排列,每一段列出了该标签正确的大小写格式,类型、值和层次.
<address>
单一标签.是<Placemark>的子元素,包含按照标准填写的地址:街道,城市,州,或邮政编码.
值:
代表一个点所在位置或邮政编码的字符串.
父元素:
被以下元素包含:
<Placemark>
子元素:
无.
<altitudeMode>
值:
clampedToGround、relativeToGround或absolute.
父元素:
被以下元素包含:
<Point>
<LineString>
<Polygon>
子元素:
无.
<begin>
单一标签.是<TimePeriod>的子元素.指定一个时间区域的开始点.如果没有指定,则代表无限小的时间.
<begin>
<TimeInstant>
<timePosition>1876-08-01<timePosition>
<TimeInstant>
<begin>
值:
使用UTC(Coordinated Universal Time)格式的日期时间 .查看<TimeInstant>和<timePosition>了解更多关于时间格式的信息.
父元素:
被以下元素包含:
<TimePeriod>
子元素:
包含:
<TimeInstant>
<color>
单一标签,代表一个32位的16进制颜色值.
值:
The standard range from 00000000 to ffffffff
父元素:
被以下元素包含:
<PolyStyle>
<LineStyle>
<IconStyle>
子元素:
无.
<coordinates>
单一标签,可以是是任何几何形状的子元素,定义每一个点的经度、纬度和高度(按照严格的顺序). 多个点使用空格隔开,经纬度按照WGS84标准.
<Point>
<coordinates>-111.661,33.2212,0<coordinates>
<Point>
值:
由点的坐标决定,经纬度的单位是度,而高度的单位是米(海拔).
注意:应该按照 经度,纬度,高度 这样的格式和顺序来设置,否则坐标可能会不准确.
父元素:
Contained by any geometry.
子元素:
无.
<description>
单一标签.提供描述信息.描述显示在用户点击该目录或标注时的弹出窗口中.
支持纯文本和HTML语法,如果其中包含有效的网址,则Google Earth会自动显示为一个连接T(例如http://www.google.com).而不需要使用任何标签
如果你使用任何的HTML语法,就必须使用字符实体引用或者CDATA来防止HTML字符如><被当作XML解析,下面的例子说明了description标签的用法:
<description>
<![CDATA[<a href="http://www.google.com.honeycomb.cs.cornell.edu:8888/">Google Search!</a>]]>
<description>
CDATA元素让KML解析器忽略其内部的特殊字符.按以下方式使用该元素:
<![CDATA[ special characters here ]]>
如果你不喜欢使用CDATA元素,你也可以使用实体引用来替换所有的特殊字符.
值:
任意字符串
注意: description标签只是支持HTML格式化,并不支持其他的网络性能,比如脚本语言和Iframe.
父元素:
被以下元素包含:
<Document>
<Folder>
<NetworkLink>
<GroundOverlay>
<ScreenOverlay>
<Placemark>
子元素:
无.
<Document>
kml文档的根元素.同时也是一个目录,可是它不是必需的,如果你的kml文件使用到了schemas和样式表,就一定要使用该标签.
<Document>
<Style id="my_style">
<Icon>./images/my_image.png<Icon>
<Style>
. . . .
<Document>
值:
无.
父元素:
无.
子元素:
Can contain the following tags:
<Folder>
<name>
<description>
<LookAt>
<visibility>
<Placemark>
<GroundOverlay>
<ScreenOverlay>
<NetworkLink>
<Document>
<drawOrder>
单一标签,是<GroundOverlay>和<ScreenOverlay>的子元素. 用来定义当多个图片重叠的时候的摆放顺序.默认值是0,该值大的图片显示将在该值小一些的图片的上面.
<drawOrder>0<drawOrder>
值:
从0到99的范围.
父元素:
被以下元素包含:
<GroundOverlay>
<ScreenOverlay>
子元素:
无.
<east>
单一标签,是<LatLonBox>.的子元素.指定图片标注右边缘的经度值.
<east>-95.1583<east>
值:
由图片标记所描述的实际地理位置决定,经度和纬度以度数表示,而高度则以海拔高度(以米为单位)来表示.
父元素:
被以下元素包含:
<LatLonBox>
子元素:
无.
<end>
是<TimePeriod>的子元素.指定一个时间区域的结束点.如果没有指定,则代表无限大的时间.
<end>
<TimeInstant>
<timePosition>2004-08-01<timePosition>
<TimeInstant>
<end>
值:
使用UTC(Coordinated Universal Time)格式的日期时间 .查看<TimeInstant>和<timePosition>了解更多关于时间格式的信息.
父元素:
被以下元素包含:
<TimePeriod>
子元素:
包含:
<TimeInstant>
<extrude>
单一标签,允许对2维的图形如地名标注、路径、多边形进行立体化处理.
值:
以米为单位的extrusion高度值.
父元素:
被以下元素包含:
<LineString>
<Polygon>
<Point>
子元素:
无.
<fill>
单一标签.指示是否对多边形进行填充.
值:
0 (不填充)或1.
父元素:
被以下元素包含:
<PolyStyle>
子元素:
无.
<Folder>
复合标签.用来对所有的标注进行树形分类. 请看关于目录的介绍获得更多信息.
<Folder>
<name>Name of Folder<name>
<description>Descriptive text<description>
<Folder>
<name>SubFolder #1 Name<name>
<description>Descriptive text<description>
<Placemark>
[placemark data here ...]
<Placemark>
<Folder>
<Folder>
<name>SubFolder #2 Name<name>
<description>Descriptive text<description>
<Placemark>
[placemark data here ...]
<Placemark>
<Folder>
<Folder>
值:
无.
父元素:
被以下元素包含:
<Document>
<Folder>
<NetworkLink>
子元素:
包含:
<Folder>
<name>
<description>
<LookAt>
<visibility>
<Placemark>
<GroundOverlay>
<ScreenOverlay>
<NetworkLink>
<Document>
<geomColor>
单一标签.是<Style>的子元素. 用来给地理点、线和多边形设置颜色,下面的例子表现一个不透明的蓝色:
<Placemark>
<Style ID="myIconStyleID">
<geomColor>ff640000<geomColor>
<Style>
<Point>
<coordinates>-122.072408, 37.412161, 6.936751<coordinates>
<Point>
<styleUrl>#myIconStyleID<styleUrl>
...
<Placemark>
注意:颜色被设置后,图标的表面颜色会被<geomColor>的颜色值进行multiply(正片叠底)处理. 例如,如果图表颜色是蓝绿色,并且你设置<geomColor>为绿黄色,最后显示出来就将会是绿色. 注意这个正片叠底模式, RGB颜色值分别相乘(R*R, G*G, B*B).因此,红色(1, 0, 0)和绿色(0, 1, 0) 最后会生成黑色,因为(1*0, 0*1, 0*0)最后是(0, 0, 0).
值:
16进制表示的颜色,包括透明度的值,顺序是alpha, blue, green, red (ABGR).
父元素:
被以下元素包含:
<Style>
子元素:
无.
<GeometryCollection>
复合标签,用来组合多个几何形状,例如组合多个多边形用来在Google Earth中描述一个单一的标注.
<GeometryCollection>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>.....
<coordinates>
<LinearRing>
<outerBoundaryIs>
<Polygon>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>.....
<coordinates>
<LinearRing>
<outerBoundaryIs>
<Polygon>
<GeometryCollection>
值:
无.
父元素:
被以下元素包含:
<Placemark>
子元素:
能够包含任何几何形状,包括其它GeometryCollection.
<geomScale>
单一标签.是<Style>的子元素.用这个标签来缩放图标(也就是地理点)和线以改变它们在Google Earth之中的显示大小.
<Style id="myPlacemarkID">
<geomScale>2<geomScale>
<labelScale>1.08</labelScale>
<geomColor>ff08ceff<labelColor>
<Icon>
<href>root://icons/....<href>
<Icon>
<Style>
通常,这个标签并不影响多边形,除非多边形使用outline模式,在这个模式下,只有多边形的外轮廓的线有效果.
值:
代表缩放到的倍数的小数.例如,默认的图标大小是1而geomScale设置为.5,则设置后图标大小便为原来的一半同样,如果geomScale设置为2则将使图表大小翻倍. 对于线段,这个只代表线宽,默认的线宽是1.
父元素:
被以下元素包含:
<Style>
子元素:
无.
<GroundOverlay>
复合标签,本标签代表一个地理图片标注.
<GroundOverlay>
<visibility>0<visibility>
<Icon>
<href>C:/GoogleEarth/example.jpg<href>
<Icon>
<drawOrder>0<drawOrder>
<LatLonBox>
<rotation>36.9994<rotation>
<north>39.3082<north>
<south>38.5209<south>
<east>-95.1583<east>
<west>-96.3874<west>
<LatLonBox>
<GroundOverlay>
值:
无.
父元素:
任何有目录功能的标签.
子元素:
包含:
<drawOrder>
<Icon> (必需)
<LatLonBox> (必需)
<visibility>
<rotation>
<h>
当在用作图标的图片上选择一个区域的时候,h是图片上被提取区域的高度像素值.
值:
一个整数值,指定图片上被提取区域的高度像素值.
父元素:
被以下元素包含:
<Icon>
子元素:
无.
<heading>
单一标签.是<LookAt>的子元素. 当前视角在水平面上的投影和正北的夹角,下面的例子表现了一个向西的视角.
<heading>-90<heading>
值:
由观测者(视点)方向决定.以度为单位.
父元素:
被以下元素包含:
<LookAt>
子元素:
无.
<href>
单一标签.是<Icon>的子元素. 用来指定图片或图标的路径.可以是本地或远程网络服务器的路径.
<Icon>
<href>C:/GoogleEarth/example.jpg<href>
<Icon>
值:
图片路径.
C:/GoogleEarth/example.jpg
如果是网络服务器上的图片,则给出该图片的URL地址:
http://www.keyhole.com/images/nav/navTopLogo.png
另外,如果要指定一个的图片做图标,你也可以实现从大图片上截取一块区域作为图标.而且这样将会有更好的性能.
例如,你可能有一张图片,由16个小图片按4X4排列而成,你可以实现引用其中的一每小块图片作为图标,只要你指定该小块图片在整个图片上的的以下四个坐标值:
x、y 坐标,小块区域左上角的像素坐标
w、h 坐标,小块区域的宽度和高度像素值
<Style id="Example">
<IconStyle>
<Icon>
<href>example.png<href>
<x>128<x>
<y>0<y>
<w>64<w>
<h>64<h>
<Icon>
<IconStyle>
<Style>
父元素:
被以下元素包含:
<Icon>
子元素:
无.
<Icon>
复合标签,是<GroundOverlay>, <ScreenOverlay>,和<IconStyle>的子元素. 必需的<href>子元素定义图片或图标的路径. 可以是本地或远程网络服务器的路径.
值:
无.
父元素:
被以下元素包含:
<GroundOverlay>
<ScreenOverlay>
<Style>
子元素:
包含:
<href>
<x>
<y>
<w>
<h>
<IconStyle>
复合标签,是<Style>的子元素并包含<Icon>元素. IconStyle指定图标的样式.
值:
字符串
父元素:
<Style>
子元素:
包含:
<Icon>
<scale>
<innerBoundaryIs>
复合标签,定义一个多变形的边.
<Polygon>
<innerBoundaryIs>
<LinearRing>
<coordinates>
-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000
<coordinates>
<LinearRing>
<innerBoundaryIs>
<Polygon>
值:
无.
父元素:
被以下元素包含:
<Polygon>
子元素:
无.
<key>
单一标签,是<Pair>的子元素.用来定义一个高亮或正常情况下的样式
<StyleMap id="example_style">
<Pair>
<key>normal</key>
<styleUrl>#example_style_off<styleUrl>
<Pair>
<Pair>
<key>highlight</key>
<styleUrl>#example_style_on<styleUrl>
<Pair>
<StyleMap>
值:
normal代表该标注的正常样式,highlight代表该标注被选中情况下的样式.
父元素:
被以下元素包含:
<Pair>
子元素:
无.
<labelColor>
单一标签,用来指定Google Earth之中的标签颜色.在<Style>标签之中使用.
<labelColor>ffff0055<labelColor>
值:
默认值是ffffffff (白色,不透明).可以是16进制的符号并按照aabbggrr(alpha, blue, green, red)排列,其中,透明度是从0(透明)-255(不透明). 要了解更多请查看关于颜色的介绍文章.
父元素:
被以下元素包含:
<Style>
子元素:
无.
<latitude>
单一标签,是<LookAt>的子元素. 指定从-90到90的纬度值.
<latitude>33.3205<latitude>
值:
由视点坐标决定,单位是度.
父元素:
被以下元素包含:
<LookAt>
子元素:
无.
<LatLonBox>
复合标签,是<GroundOverlay>的子元素.用来指定该图片标注的地理坐标.
<LatLonBox>
<rotation>36.9994<rotation>
<west>-96.3874<west>
<east>-95.1583<east>
<south>38.5209<south>
<north>39.3082<north>
<LatLonBox>
值:
无.
父元素:
被以下元素包含:
<GroundOverlay>
子元素:
包含:
<east>
<west>
<north>
<south>
<rotation> (可选)
<LinearRing>
复合标签,定义一个闭合的折线,以描述一个多边形. 使用<coordinates>标签说明折线的每一个点的坐标,最后的点将会和第一点连接以使图形闭合.
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000
<coordinates>
<LinearRing>
<outerBoundaryIs>
<Polygon>
值:
无.
父元素:
被以下元素包含:
<Polygon>
子元素:
包含:
<coordinates>
<LineString>
复合标签,用来定义一段折线. 以坐标值字符串的形式定义该折线的轨迹.使用<coordinates>元素来描绘每个点的坐标.
值:
无.
父元素:
被以下元素包含:
<Placemark>
<GeometryCollection>
子元素:
包含:
<coordinates>
<longitude>
单一标签,是<LookAt>的子元素. 指定从-180到180的经度值.
<longitude>-111.965<longitude>
值:
由视点坐标决定,单位是度.
父元素:
被以下元素包含:
<LookAt>
子元素:
无.
<LookAt>
复合标签.为标注或目录定义观测者坐标(视点).
<LookAt>
<heading>-0.00895499<heading>
<tilt>39.4365<tilt>
<range>214.17<range>
<latitude>37.3895<latitude>
<longitude>-122.086<longitude>
<LookAt>
值:
无.
父元素:
被以下元素包含:
<Folder>
<Document>
<Placemark>
<GroundOverlay>
子元素:
包含:
<heading>
<latitude>
<longitude>
<range>
<name>
单一标签.用来显示为一个标注的简单名称,或者在<Schema>元素之中代表标示符.
<Folder>
<name>Favourite Places<name>
. . .
<Folder>
值:
任意字符串.
父元素:
被以下元素包含:
<Folder>
<Document>
<GroundOverlay>
<Placemark>
<ScreenOverlay>
<Schema>
子元素:
无.
<NetworkLink>
复合标签,用来定义一个引用的本地或远程的KML文件.
<NetworkLink>
<refreshVisibility>0<refreshVisibility>
<refreshInterval>121<refreshInterval>
<Url>
<href>//myServer/Googleearth/example.kmlM.<href>
<Url>
<visibility>1<visibility>
<name>TestNetworkLink<name>
<NetworkLink>
值:
无.
父元素:
被以下元素包含:
<Folder>
<Document>
子元素:
包含:
<refreshVisibility>
<refreshInterval>
<<Url>>
<name>
<visibility>
<north>
单一标签,是<LatLonBox>的子元素.指定图片标注上边缘的纬度值.
<north>39.3082<north>
值:
由图片标记所描述的实际地理位置决定,经度和纬度以度数表示.
父元素:
被以下元素包含:
<LatLonBox>
子元素:
无.
<ObjArrayField>
复合标签,是<Schema>的子元素.用来为一个schema对象定义一个字段数组类型. 使用 <type>元素指定数组中类型的名称.
值:
无.
父元素:
被以下元素包含:
<Schema>
子元素:
包含:
<name>
<type>
<ObjField>
复合标签,是<Schema>的子元素.用来为一个schema对象定义一个字段类型.使用 <type>元素指定类型的名称.
值:
无.
父元素:
被以下元素包含:
<Schema>
子元素:
包含:
<name>
<type>
<open>
单一标签,指示目录是否默认被展开.
值:
在载入时,如果值为1,则该目录默认会被展开,如果值为1,则默认是闭合的,如果目录包含大量的标注,最好确保目录默认闭合状态.
父元素:
被以下元素包含:
<Folder>
子元素:
None.
<outerBoundaryIs>
复合标签,定义一个多边形的各个边.必需.
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000
<coordinates>
<LinearRing>
<outerBoundaryIs>
<Polygon>
值:
无.
父元素:
被以下元素包含:
<Polygon>
子元素:
包含:
<LinearRing>
<outline>
单一标签,只是多边形是否只绘制轮廓
值:
0 (no outline) or 1.
父元素:
被以下元素包含:
<PolyStyle>
子元素:
无.
<overlayXY>
单一标签,是<ScreenOverlay>的子元素. 定义标注图片上用来和屏幕坐标对应的一点在图片自身上的坐标. 应该有X和Y两个值和各自的单位(像素(pixels)或比例(fraction)). 例如:<overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/>代表图片的右上角. 和<screenXY of x="-50" y="0.9" xunits="pixels" yunits="fraction"/>一起使用, 将会使图片右上角离屏幕右边缘距离为50像素,距离屏幕顶端距离是屏幕高度的10%.
值:
x和y能够用以下方式指定:
将图片显示在屏幕的中间:
<overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
将图片显示在屏幕的左上角:
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
将图片显示在屏幕的右边:
<overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="1" y="1" xunits="fraction" yunits="fraction"/>
父元素:
被以下元素包含:
<ScreenOverlay>
子元素:
无.
<Pair>
复合标签,是<StyleMap>的子元素.用力定义一个名称/值对以便为标注提供多样化的样式支持.
值:
无.
父元素:
被以下元素包含:
<StyleMap>
子元素:
Must contain the following:
<key>
<styleUrl>
<parent>
单一标签,是<Schema>的子元素.指定添加的schema字段所继承的基本类型.
<Schema>
<name>High School<name>
<parent>Placemark<parent>
<SimpleField>
<name>Address<name>
<type>wstring<type>
<SimpleField>
<SimpleField>
<name>Average SAT score<name>
<type>int<type>
<SimpleField>
<Schema>
值:
一个已经存在的KML基本类型,查看KML基本类型获得更多信息.
父元素:
被以下元素包含:
<Schema>
子元素:
无.
<Placemark>
复合标签.用来描述一个地名标注.例如,可以用来描述一个地理坐标点,坐标必须以[经度,纬度,高度]来指定,而且:
经度: 在-180和180之间
纬度:在-90和90
高度:以米为单位的海拔高度(WGS84). 在地表面下面的点将会自动显示在地表面以上.
另外,你可以为placemark定义一系列其他的元素如视点、名称和描述.
<Placemark>
<name>Queen Creek<name>
<LookAt>
<longitude>-111.634<longitude>
<latitude>33.2407<latitude>
<range>5571.15<range>
<tilt>-0.0129749<tilt>
<heading>-0.0651017<heading>
<LookAt>
<visibility>1<visibility>
<styleUrl>root://styleMaps#default?iconId=0x300<styleUrl>
<Point>
<coordinates>-111.634,33.2486,413.037<coordinates>
<Point>
<Placemark>
值:
无.
父元素:
被以下元素包含:
<Folder>
<Document>
子元素:
包含:
<description>
<name>
<Point>
<styleUrl>
<LookAt>
<visibility>
<Point>
复合标签.定义地图上一个点的坐标.使用<coordinates>指定坐标的位置.
<Point>
<coordinates>-111.965,33.3217,355.27 <coordinates>
<Point>
值:
无.
父元素:
被以下元素包含:
<Placemark>
<GeometryCollection>
子元素:
包含:
<coordinates>
<Polygon>
复合标签,在地图上定义一个多边形.默认使用<outerBoundaryIs>来定义各边.
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000
<coordinates>
<LinearRing>
<outerBoundaryIs>
<Polygon>
值:
无.
父元素:
被以下元素包含:
<Placemark>
<GeometryCollection>
子元素:
包含:
<outerBoundaryIs>
<innerBoundaryIs>
<PolyStyle>
复合标签.使用在<Style>标签之中,为多边形指定样式
值:
无.
父元素:
被以下元素包含:
<Style>
子元素:
包含:
<color>
<fill>
<outline>
<range>
单一标签,是<LookAt>的子元素.描述当前视点的海拔,以米为单位.
<range>909.907<range>
值:
由视点的位置决定.
父元素:
只能被<LookAt>包含.
子元素:
无.
<refreshInterval>
单一标签.用来指定刷新一个网络KML文件或图片标注的时间秒数.
<NetworkLink>
<refreshVisibility>0<refreshVisibility>
<refreshInterval>121<refreshInterval>
<<Url>>//myServer/GoogleEarth/example.kml</<Url>>
<visibility>1<visibility>
<name>TestNetworkLink<name>
<NetworkLink>
值:
以秒为单位.如果该值大于0,则该项每n秒刷新一次,如果该值小于0,则该项根本不会被加载,如果该值等于0,则该项会被加载一次而不会再被刷新.
父元素:
被以下元素包含:
<NetworkLink>
<GroundOverlay>
<ScreenOverlay>
子元素:
无.
<refreshVisibility>
单一标签,是<NetworkLink>的子元素.指定网络KML文件被重新加载刷新的时候是否忽略KML文档之中各标注的默认可见性.
值:
默认值是0,即忽略KML文档中的默认可见性设置而使所有标注的可见性不变 . 更改为1既可以在每次网络KML文件被刷新之后重新根据KML文件内容设置标注的可见性. 例如,假设有一项在KML文件之中可见性设置为0,而且refreshVisibility设置为1,当文件第一次加载到Google Earth之中的时候,该项是不显示的如果用户通过点击该项的复选框而已经使该项显示出来,这种情况下该网络KML文件被刷新之后,该项又会重新变成不显示.
翻译到这里,我只好感叹又学了一招,我刚才试了一下,果然不错,非常有用。
父元素:
被以下元素包含:
<NetworkLink>
子元素:
无.
<rotation>
单一标签,是<ScreenOverlay>, <GroundOverlay>和<LatLonBox>的子元素.用来指定图片围绕本身中心的旋转角.
值:
使用-180~+180的角度值来指定从0度开始的顺时针旋转角.0为默认值(不旋转)
父元素:
被以下元素包含:
<GroundOverlay>
<ScreenOverlay>
<LatLonBox>
子元素:
无.
<Schema>
复合标签.用来定义一个schema以便让KML理解并不被默认支持的语法.您可以用XML模式定义您自己的语法
值:
无.
父元素:
无.
子元素:
包含:
<name>
<parent>
<ObjField>
<ObjArrayField>
<SimpleField>
<SimpleArrayField>
<scale>
指定该标注横向、纵向的缩放倍数.
值:
从0-1的小数.
父元素:
被以下元素包含:
<IconStyle>
<LabelStyle>
子元素:
无.
<ScreenOverlay>
A 复合标签. 本标定义一个屏幕图片标注.将一个图片(以图片本身大小和纵横比)显示在屏幕的正中间的代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<ScreenOverlay id="khScreenOverlay756">
<description>This screen overlay uses fractional positioning to put the image in the exact center of the screen<description>
<name>Simple crosshairs<name>
<visibility>0<visibility>
<Icon>
<href>http://myserver/myimage.jpg<href>
<Icon>
<overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<size x="0" y="0" xunits="pixels" yunits="pixels"/>
<ScreenOverlay>
</kml>
值:
无.
父元素:
被以下元素包含:
<Folder>
<Document>
子元素:
包含:
<drawOrder>
<Icon> (必需)
<visibility>
<rotation>
<size>
<screenXY>
<overlayXY>
<screenXY>
单一标签,是<ScreenOverlay>的子元素. 定义图片标注在屏幕上的绘制位置.例如,screenXY为(-50, .9)并且overlayXY为(1,1)将会使图片右上角离屏幕右边缘距离为50像素,距离屏幕顶端距离是屏幕高度的10%.
值:
x和y能够用以下方式指定:
将图片显示在屏幕的中间:
<overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
将图片显示在屏幕的左上角:
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
将图片显示在屏幕的右边:
<overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="1" y="1" xunits="fraction" yunits="fraction"/>
父元素:
被以下元素包含:
<ScreenOverlay>
子元素:
无.
<SimpleArrayField>
复合标签,是<Schema>的子元素.用来定义单个字段类型的数组例如整数数组、浮点数数组或字符串数组.
值:
无.
父元素:
被以下元素包含:
<Schema>
子元素:
包含:
<name>
<type>
<SimpleField>
复合标签,是<Schema>的子元素.用来定义单个字段类型例如整数、浮点数或字符串.
<SimpleField>
<name>height<name>
<type>int<type>
<SimpleField>
值:
无.
父元素:
被以下元素包含:
<Schema>
子元素:
包含:
<name>
<type>
<size>
单一标签,是<ScreenOverlay>.的子元素.用来指定图片的大小.
值:
用法如下.
使用图片本身的大小和纵横比,应将值设成0:
<size x="0" y="0" xunits="fraction" yunits="fraction"/>
使图片宽度不变,高度变为原来的80%:
<size x="0" y="0.2" xunits="fraction" yunits="fraction"/>
强制图片大小为100*500:
<size x="100" y="500" xunits="pixels" yunits="pixels"/>
父元素:
被以下元素包含:
<ScreenOverlay>
子元素:
无.
<south>
单一标签,是<LatLonBox>.的子元素.指定图片标注底边缘的纬度值.
<south>38.5209<south>
值:
由图片标记所描述的实际地理位置决定,经度和纬度以度数表示
父元素:
被以下元素包含:
<LatLonBox>
子元素:
无.
<snippet>
单一标签,用来显示在Google Earth之中的对description的简短概要.
值:
任意值
父元素:
被以下元素包含:
<Placemark>
子元素:
无.
<Style>
复合标签,用来指定显示样式诸如自定义图标、几何形状、颜色和标签大小. 样式被标注和几何形状通过ID来引用,因此你可以让多个标注或几何形状共享一个样式.
注意:为了被引用,样式必须有一个ID属性.
<Style id="myStyle">
<polyMode>outlineFill</polyMode>
<geomScale>1<geomScale>
<labelScale>1</labelScale>
<geomColor>ff0000ff<geomColor>
<Style>
你也可以在<Placemark>元素内部定义一个<Style>,这个样式就是该标注的本地样式,因此会覆盖所有的相应的引用样式(例如从<styleUrl>引用的样式)的设置.基于性能考虑,应该尽量少使用本地样式.
值:
样式有一个ID属性,在样式被引用的时候使用.
父元素:
被以下元素包含:
<Document>
<Folder>
子元素:
包含:
<Icon>
<polyMode>
<geomScale>
<geomColor>
<labelScale>
<labelColor>
<StyleMap>
复合标签.用来对标注进行第二层的样式表引用.例如当一个地名标注存在正常和高亮两种图标的时候使用<StyleMap>元素.
<StyleMap id="homestoremap">
<Pair>
<key>normal</key>
<styleUrl>#homestoreoff<styleUrl>
<Pair>
<Pair>
<key>highlight</key>
<styleUrl>#homestoreon<styleUrl>
<Pair>
<StyleMap>
值:
使用样式表ID作为该元素的ID属性
父元素:
被以下元素包含:
<Document>
子元素:
包含:
<Pair>
<styleUrl>
单一标签. 通过URL引用一个<Style>, <StyleMap> or <StyleBlinker>.假如被引用的样式表元素就在当前文档之中,可以仅仅使用一个#来引用,例如:
<styleUrl> #myIconStyleID<styleUrl>
<styleUrl>http://someserver.com/somestylefile.xml#restaurant<styleUrl>
值:
ID或者URL指向被引用的样式表元素.
父元素:
被以下元素包含:
<Placemark>
<Pair>
<State>
子元素:
无.
<tessellate>
设置是否允许线条根据地形而自动调整.
值:
0 (不进行自动调整)或1.
父元素:
被以下元素包含:
<LineString>
子元素:
无.
<tilt>
单一标签,<LookAt>的子标签. 代表视点到指定点的角度(视角),值为0代表没有倾斜,即在Google earth中的视角是垂直向下的.值为90代表最大倾斜度,即在Google earth中视角是水平的.
<tilt>0.000000<tilt>
值:
代表视角倾斜度的数值,单位可以是十进制的度数,也可以是其他标准GIS数值.
父元素:
被以下元素包含:
<LookAt>
子元素:
无.
<TimePeriod>
复合标签.该标签通过指定起始时间和终止时间来定义一个时间范围:
begin
end
0?
90?
如果缺少一个时间点,那么这个时间点代表的边界就不存在,例如,下面的例子说明California从1876-08-01成为美国的一个州,并永远是美国的一个州,因为<end>标签没有指定:
<Placemark>
<name>California<name>
.
.
.
<TimePeriod>
<begin>
<TimeInstant>
<timePosition>1876-08-01<timePosition>
<TimeInstant>
<begin>
<TimePeriod>
<Placemark>
值:
无.
父元素:
无.
子元素:
包含:
<begin>
<end>
<TimeInstant>
复合标签,代表一个时间点的实例(类似一个空间点).该事件实例的精确度是<timePosition>标签中指定的时间精确度:
dateTime精确到秒
date精确到日
gYearMonth精确到月
gYear精确到年
注意:不支持毫秒.
<TimeInstant>
<timePosition>1959-01-03<timePosition>
<TimeInstant>
值:
无.
父元素:
无.
子元素:
包含:
<timePosition>
<timePosition>
单一标签,描述一个UTC(Coordinated Universal Time,查看http://www.w3.org/TR/NOTE-datetime/获取更多信息)的日期时间, 可以用以下格式描述:
年份(YYYY)
<begin>1997<begin>
年份和月份(YYYY-MM)
<begin>1997-07<begin>
完整日期(YYYY-MM-DD)
<begin>1997-07-16<begin>
日期和时钟分钟(YYYY-MM-DDThh:mmZ)
这儿T代表日期和时间之间的分隔符,Z是表示这是GMT时间.
<begin>1997-07-16T07:30Z<begin>
完整的日期时间(YYYY-MM-DDThh:mm:ssZ)
<begin>1997-07-16T07:30:15Z<begin>
注意:dateTime类型不允许从左至右的截断(比如省略秒钟),并且不支持小数格式的秒钟,查看 http://www.w3.org/TR/xmlschema-0/#CreatDt获取更多信息.
<timePosition>1959-01-03<timePosition>
值:
使用UTC格式的日期时间,可以用yyyy-mm-ddThh:mm:ss格式来书写,T是日期和时间之间的分隔符,另外,也可以只指定日期而不指定时间.
父元素:
被以下元素包含:
<TimeInstant>
子元素:
无.
<type>
单一标签,schema字段类型的子元素.用来定义在schema中定义的子段的类型.
<SimpleField>
<name>Population<name>
<type>int<type>
<SimpleField>
值:
可能的值有:
uint
short
ushort
float
double
bool
string
wstring (长string,UCS2 unicode编码)
sharedstring
sharedwstring
Vec2f (2维矢量,float)
Vec3d (3维矢量,double)
icon
父元素:
被以下元素包含:
<ObjField>
<ObjArrayField>
<SimpleField>
<SimpleArrayField>
子元素:
无.
<href>
单一标签,<Url>的子标签.
值:
无.
父元素:
被以下元素包含:
<Url>
子元素:
无.
<Url>
复合标签,<NetworkLink>的子元素.
值:
无.
父元素:
被以下元素包含:
<NetworkLink>
子元素:
包含:
<href> (必需)
<refreshInterval>
<refreshMode>
<viewRefreshMode>
<viewRefreshTime>
<viewRefreshMode>
单一标签,是<NetworkLink>的子元素.指定在什么情况下向<href>网络服务器发送当前视角坐标.
值:
onStop 代表视图窗口停顿n秒后, n在<viewRefreshTime>标签之中指定.
父元素:
被以下元素包含:
<Url>
子元素:
无.
<viewRefreshTime>
单一标签,是<NetworkLink>的子元素. 指定向网络服务器发送当前视角坐标的频率.
值:
一个代表秒的整数
父元素:
被以下元素包含:
<Url>
子元素:
无.
<visibility>
单一标签,定义目录、地名标记、图片标记的默认可见性
<Placemark>
<name>The Home Store, Site #3<name>
<visibility>0<visibility>
. . . .
<Placemark>
值:
0 代表默认不显示
1 代表默认显示
父元素:
被以下元素包含:
<Folder>
<Document>
<GroundOverlay>
<Placemark>
<ScreenOverlay>
子元素:
无.
<w>
当在用作图标的图片上选择一个区域的时候,w是图片上被提取区域的宽度像素值.
值:
一个整数值,指定图片上被提取区域的宽度像素值.
父元素:
被以下元素包含:
<Icon>
子元素:
无.
<west>
单一标签,是<LatLonBox>的子元素.指定图片标注左边缘的经度值.
<west>-96.3874<west>
值:
由图片标记所描述的实际地理位置决定,经度和纬度以度数表示,而高度则以海拔高度(以米为单位)来表示.
父元素:
被以下元素包含:
<LatLonBox>
子元素:
无.
<x>
当在用作图标的图片上选择一个点的时候,x是该点到图片左端的像素距离.
值:
一个整数值,指定图片上某点到图片左端的像素距离.
父元素:
被以下元素包含:
<href>
子元素:
无.
<y>
当在用作图标的图片上选择一个点的时候,y是该点到图片底端的像素距离.
值:
一个整数值,指定图片上某点到图片底端的像素距离.
父元素:
被以下元素包含:
<href>
子元素:
无.
|