將EntityCollection導(dǎo)出為KML文檔。將只導(dǎo)出點(diǎn)、公告牌、模型、路徑、多邊形、多段線幾何圖形。注意,沒有實(shí)體屬性到KML功能屬性的1到1映射。例如,在kml中,時(shí)間動態(tài)但不能動態(tài)的實(shí)體屬性將與其值一起導(dǎo)出到options.time或EntityCollection的時(shí)間間隔的開始處(如果未指定)。對于kml中支持的時(shí)間動態(tài)屬性,如果樣本為
SampledProperty
,則使用樣本;否則,使用options.sampleDuration對值進(jìn)行采樣。具有時(shí)間動態(tài)位置的點(diǎn)、廣告牌、模型和路徑幾何圖形將導(dǎo)出為gx:軌跡特征。不是所有的材料都可以用kml表示,所以對于更高級的材料,只使用原色。畫布對象導(dǎo)出為PNG圖像。
Parameters:
options
(Object)
一個(gè)
Name | Description |
---|---|
options.entities
EntityCollection
|
要導(dǎo)出為KML的EntityCollection。 |
options.ellipsoid
Ellipsoid
default Ellipsoid.WGS84
|
輸出文件的橢球體。 |
options.modelCallback
exportKml~ModelCallback
|
將使用ModelGraphics 實(shí)例調(diào)用的回調(diào),應(yīng)返回要在KML中使用的URI。如果實(shí)體集合中存在模型,則為必需。
|
options.time
JulianDate
default entities.computeAvailability().start
|
用于獲取在kml中不隨時(shí)間變化的屬性的時(shí)間值。 |
options.defaultAvailability
TimeInterval
default entities.computeAvailability()
|
如果實(shí)體沒有可用性,將采樣的間隔。 |
options.sampleDuration
Number
default 60
|
采樣屬性的秒數(shù),在kml中有所不同。 |
options.kmz
Boolean
default false
|
如果真的kml和外部文件將被壓縮成kmz文件。 |
Example
bmgl.exportKml({
entities: entityCollection
})
.then(function(result) {
// The XML string is in result.kml
var externalFiles = result.externalFiles
for(var file in externalFiles) {
// file is the name of the file used in the KML document as the href
// externalFiles[file] is a blob with the contents of the file
}
});