„NASA World Wind SDK” változatai közötti eltérés
Ugrás a navigációhoz
Ugrás a kereséshez
| 11. sor: | 11. sor: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
// Példa adat | |||
var peaks = | |||
[ | |||
{ | |||
'name': "Mount McKinley\n(Denali)", // Mount McKinley | |||
'state': "Alaska", | |||
'elevation': 6194, | |||
'latitude': 63.0690, | |||
'longitude': -151.0063 | |||
}]; | |||
var text, | var text, | ||
textAttributes = new WorldWind.TextAttributes(null), | textAttributes = new WorldWind.TextAttributes(null), | ||
textLayer = new WorldWind.RenderableLayer("U.S.A. Peaks"); | textLayer = new WorldWind.RenderableLayer("U.S.A. Peaks"); | ||
//Alap attribútumok beállítása (pl: szín) | |||
textAttributes.color = WorldWind.Color.CYAN; | |||
// Set the depth test property such that the terrain does not obscure the text. | |||
textAttributes.depthTest = false; | |||
//Létrehozzuka szöeg "alakzatokat" | |||
for (var i = 0, len = peaks.length; i < len; i++) { | |||
var peak = peaks[i], | |||
peakPosition = new WorldWind.Position(peak.latitude, peak.longitude, peak.elevation); | |||
text = new WorldWind.GeographicText(peakPosition, peak.name + "\n" + peak.state); | |||
//Beállítjuk az alakzatohoz a szöveget | |||
text.attributes = textAttributes; | |||
//Hozzáadjuk a szöveget a layerhez | |||
textLayer.addRenderable(text); | |||
} | |||
//A szöveg layert hozzáadjuk a globál layerhez | |||
wwd.addLayer(textLayer); | |||
//Létrehozunk egy managert, hogy tudjuk vezérelni a szöveg réteget. | |||
var layerManger = new LayerManager(wwd); | |||
</source> | </source> | ||
A lap 2017. április 24., 07:44-kori változata
Bevezetés
A NASA World Wind SDK egy ingyenes API virtuális glóbuszokhoz. Segítségével könnyen vizualizálható interaktív háromdimenziós glóbusz vagy bármilyen földrajzi információ.
http://people.inf.elte.hu/hagtabi/foldgomb
Főbb funkcionalitások
Alakzatok
Szöveg
// Példa adat
var peaks =
[
{
'name': "Mount McKinley\n(Denali)", // Mount McKinley
'state': "Alaska",
'elevation': 6194,
'latitude': 63.0690,
'longitude': -151.0063
}];
var text,
textAttributes = new WorldWind.TextAttributes(null),
textLayer = new WorldWind.RenderableLayer("U.S.A. Peaks");
//Alap attribútumok beállítása (pl: szín)
textAttributes.color = WorldWind.Color.CYAN;
// Set the depth test property such that the terrain does not obscure the text.
textAttributes.depthTest = false;
//Létrehozzuka szöeg "alakzatokat"
for (var i = 0, len = peaks.length; i < len; i++) {
var peak = peaks[i],
peakPosition = new WorldWind.Position(peak.latitude, peak.longitude, peak.elevation);
text = new WorldWind.GeographicText(peakPosition, peak.name + "\n" + peak.state);
//Beállítjuk az alakzatohoz a szöveget
text.attributes = textAttributes;
//Hozzáadjuk a szöveget a layerhez
textLayer.addRenderable(text);
}
//A szöveg layert hozzáadjuk a globál layerhez
wwd.addLayer(textLayer);
//Létrehozunk egy managert, hogy tudjuk vezérelni a szöveg réteget.
var layerManger = new LayerManager(wwd);