All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.earth.worldwind.layer.BackgroundLayer.kt Maven / Gradle / Ivy

Go to download

The WorldWind Kotlin SDK (WWK) includes the library, examples and tutorials for building multiplatform 3D virtual globe applications for Android, Web and Java.

The newest version!
package earth.worldwind.layer

import earth.worldwind.MR
import earth.worldwind.geom.Sector
import earth.worldwind.render.image.ImageConfig
import earth.worldwind.render.image.ImageOptions
import earth.worldwind.render.image.ImageSource
import earth.worldwind.shape.SurfaceImage
import kotlin.jvm.JvmOverloads

/**
 * Displays a single image spanning the globe. By default, BackgroundLayer is configured to display NASA's Blue Marble
 * next generation image at 40km resolution from the built-in WorldWind library resource
 * res/drawable/worldwind_worldtopobathy2004053.
 */
class BackgroundLayer @JvmOverloads constructor(
    imageSource: ImageSource = ImageSource.fromResource(MR.images.worldwind_worldtopobathy2004053),
    imageOptions: ImageOptions = ImageOptions(ImageConfig.RGB_565)
) : RenderableLayer("Background") {
    // Disable picking for the layer because it covers the full sphere and will override a terrain pick.
    override var isPickEnabled = false

    init {
        // Delegate display to the SurfaceImage shape.
        val surfaceImage = SurfaceImage(Sector().setFullSphere(), imageSource)
        surfaceImage.imageOptions = imageOptions
        addRenderable(surfaceImage)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy