0

如何使用“Google Earth API”或其他方法在此视频上创建类似内容(1-2分钟http://www.ted.com/index.php/talks/sergey_brin_and_larry_page_on_google.html)?使用任何Earth API进行实时数据可视化

特别是:我有一个在线游戏,并希望显示一些“虚拟地球”上的动态数据。 3种类型的对象实时改变它们的状态。每5秒更新一次就足够了。我已经为它打开了api。

问题是我不知道是否有可能从球体中心画出类似彩色线条的东西并动态改变它们。

对不起,一个抽象的问题,但目标是一样的。

回答

3

那么,如果您使用的是Google Earth API(需要安装Google Earth插件),那么您可以创建一堆拉伸的多边形。例如,如果你去Earth API Interactive Sampler和粘贴/运行此:

var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND); 
var lat = lookAt.getLatitude(); 
var lng = lookAt.getLongitude(); 

// first create inner and outer boundaries 
// outer boundary is a square 
var outerBoundary = ge.createLinearRing(''); 
var coords = outerBoundary.getCoordinates(); 
coords.pushLatLngAlt(lat - 0.5, lng - 0.5, 1000000); 
coords.pushLatLngAlt(lat - 0.5, lng + 0.5, 1000000); 
coords.pushLatLngAlt(lat + 0.5, lng + 0.5, 1000000); 
coords.pushLatLngAlt(lat + 0.5, lng - 0.5, 1000000); 

// create the polygon and set its boundaries 
var polygon = ge.createPolygon(''); 
polygon.setExtrude(true); 
polygon.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_GROUND); 
polygon.setOuterBoundary(outerBoundary); 

// create the polygon placemark and add it to Earth 
var polygonPlacemark = ge.createPlacemark(''); 
polygonPlacemark.setGeometry(polygon); 
ge.getFeatures().appendChild(polygonPlacemark); 

// persist the placemark for other interactive samples 
window.placemark = polygonPlacemark; 
window.polygonPlacemark = polygonPlacemark; 

你会看到挤出全球的3D多边形。

你可以用这个做更多的事情;我建议您访问code.google.com/apis/earth和code.google.com/apis/kml,使用Earth API和KML(地球API中的几何图元基础)。

+0

我不认为这回答了这个问题。没有什么*实时*在这个答案... – Sklivvz 2012-04-20 15:40:35