Skip to content

Instantly share code, notes, and snippets.

@ComBatVision
Last active October 1, 2022 15:40
Show Gist options
  • Save ComBatVision/4d60177d6618d72df2a24c41bd2c7946 to your computer and use it in GitHub Desktop.
Save ComBatVision/4d60177d6618d72df2a24c41bd2c7946 to your computer and use it in GitHub Desktop.
Example of usage WorldWindKotlin on JS
fun main() {
// Register an event listener to be called when the page is loaded.
window.onload = {
// Create a WorldWindow for the canvas.
val canvas = document.getElementById("WorldWindow") as HTMLCanvasElement
val wwd = WorldWindow(canvas)
// Add some image layers to the WorldWindow's globe.
with(wwd.engine.layers) {
addLayer(BackgroundLayer())
addLayer(BlueMarbleLandsatLayer())
addLayer(AtmosphereLayer())
}
// Add elevation coverage source
wwd.engine.globe.elevationModel.addCoverage(BasicElevationCoverage())
// Request redraw WorldWindow to display new layers
wwd.requestRedraw()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment