Skip to content

Commit 553259a

Browse files
save commit, add image and placemark
1 parent 6e3d7b7 commit 553259a

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

worldwind-tutorials/src/commonMain/kotlin/earth.worldwind.tutorials/SurfaceImageTutorial.kt

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,56 @@ import earth.worldwind.WorldWind
44
import earth.worldwind.geom.AltitudeMode
55
import earth.worldwind.geom.Angle
66
import earth.worldwind.geom.Angle.Companion.degrees
7+
import earth.worldwind.geom.Location
78
import earth.worldwind.geom.Sector
89
import earth.worldwind.layer.RenderableLayer
910
import earth.worldwind.render.image.ImageSource
1011
import earth.worldwind.shape.SurfaceImage
12+
import earth.worldwind.geom.Position
13+
import earth.worldwind.render.Color
14+
import earth.worldwind.shape.Placemark
15+
import earth.worldwind.shape.TextureQuad
16+
import earth.worldwind.shape.ShapeAttributes
1117

1218
class SurfaceImageTutorial(private val engine: WorldWind) : AbstractTutorial() {
1319

1420
private val layer = RenderableLayer("Surface image").apply {
1521
// Configure a Surface Image to display an Android resource showing the WorldWindEarth logo.
22+
val sector1 = Sector.fromDegrees(37.46, 15.5, 0.5, 0.6)
23+
val sector2 = Sector.fromDegrees(36.46, 14.5, 1.5, 1.9)
24+
val sector3 = Sector.fromDegrees(51.272140, 30.010303, 0.09, 0.02)
25+
val sector4 = Sector.fromDegrees(51.265140, 30.010303, 0.09, 0.02)
1626
addRenderable(
17-
SurfaceImage(
18-
Sector.fromDegrees(37.46, 15.5, 0.5, 0.6),
19-
ImageSource.fromResource(MR.images.worldwind_logo)
20-
)
27+
TextureQuad(
28+
Location(sector3.minLatitude, sector3.maxLongitude),
29+
Location(sector3.minLatitude, sector3.minLongitude),
30+
Location(sector4.minLatitude, sector4.minLongitude),
31+
Location(sector4.minLatitude, sector4.maxLongitude),
32+
ImageSource.fromResource(MR.images.korogode_image)
33+
).apply { opacity = 0.9f }
2134
)
2235

23-
// Configure a Surface Image to display a remote image showing Mount Etna erupting on July 13th, 2001.
2436
addRenderable(
25-
SurfaceImage(
26-
Sector.fromDegrees(37.46543388598137, 14.60128369746704, 0.45360804083528, 0.75704283995502),
27-
ImageSource.fromUrlString("https://worldwind.arc.nasa.gov/android/tutorials/data/etna.jpg")
28-
)
37+
Placemark.createWithColorAndSize(
38+
Position(sector3.minLatitude, sector3.maxLongitude, 0.0), Color(0f, 1f, 1f, 1f), 20
39+
).apply {
40+
altitudeMode = AltitudeMode.CLAMP_TO_GROUND
41+
}
2942
)
43+
// addRenderable(
44+
// SurfaceImage(
45+
// Sector.fromDegrees(37.46, 15.5, 0.5, 0.6),
46+
// ImageSource.fromResource(MR.images.worldwind_logo)
47+
// )
48+
// )
49+
//
50+
// // Configure a Surface Image to display a remote image showing Mount Etna erupting on July 13th, 2001.
51+
// addRenderable(
52+
// SurfaceImage(
53+
// Sector.fromDegrees(37.46543388598137, 14.60128369746704, 0.45360804083528, 0.75704283995502),
54+
// ImageSource.fromUrlString("https://worldwind.arc.nasa.gov/android/tutorials/data/etna.jpg")
55+
// )
56+
// )
3057
}
3158

3259
override fun start() {
405 KB
Loading

0 commit comments

Comments
 (0)