2013-01-08 21 views
1

我已经安装了Google地球插件,它似乎正常工作。如何在Chrome中启动Google地球插件

我想要做的是打开一个KML文件(从Android上的MyTracks导出)。

但是,我无法找到打开KML文件或启动GE插件的选项。

这可能吗?

回答

0

要启动该插件,请查看developer's guide中的'Using the Google Earth Api'部分。

对于加载KML文件,看看下面的文档https://developers.google.com/earth/documentation/kml

它给出了如何fetchKml and parseKml以及链接到working example例子。

var href = 'http://code.google.com/' 
       + 'apis/earth/documentation/samples/kml_example.kml'; 

google.earth.fetchKml(ge, href, function(kmlObject) { 
    if (kmlObject) { 
    ge.getFeatures().appendChild(kmlObject); 
    } 
}); 

你也可以使用一个KmlNetworkLinkload the data再次文档链接到这个working example

var link = ge.createLink(''); 
var href = 'http://code.google.com/' 
      + 'apis/earth/documentation/samples/kml_example.kml' 
link.setHref(href); 

var networkLink = ge.createNetworkLink(''); 
networkLink.set(link, true, true); // Sets the link, refreshVisibility, and flyToView 

ge.getFeatures().appendChild(networkLink); 
相关问题