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