This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a simple view of a globe with touch navigation and a few layers. | |
*/ | |
open class BasicGlobeActivity: Activity() { | |
/** | |
* The WorldWindow (GLSurfaceView) maintained by this activity | |
*/ | |
override lateinit var wwd: WorldWindow | |
override fun onCreate(savedInstanceState: Bundle?) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |