Skip to content

Commit 93ddbd4

Browse files
add drawOutline parameter to example
1 parent d1e00a2 commit 93ddbd4

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

worldwind-examples-android/src/main/kotlin/earth/worldwind/examples/TextureQuadExampleActivity.kt

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class TextureQuadExampleActivity: GeneralGlobeActivity() {
120120
Location(51.27062637593827.degrees, 30.01240117718469.degrees),
121121
Location(51.271804026840556.degrees, 30.01029779181104.degrees),
122122
Location(51.270125460836965.degrees, 30.00779959572076.degrees),
123-
ImageSource.fromResource(R.drawable.korogode_image)
123+
ImageSource.fromResource(R.drawable.korogode_image), true
124124
)
125125
)
126126
}
@@ -160,16 +160,6 @@ class TextureQuadExampleActivity: GeneralGlobeActivity() {
160160
"Car", "SUV", "4x4", "Truck", "Jeep", "Tank"
161161
)
162162

163-
// Resource IDs for aircraft icons
164-
private val aircraftIcons = intArrayOf(
165-
R.drawable.aircraft_small,
166-
R.drawable.aircraft_twin,
167-
R.drawable.aircraft_jet,
168-
R.drawable.aircraft_fighter,
169-
R.drawable.aircraft_bomber,
170-
R.drawable.aircraft_rotor
171-
)
172-
173163
// Resource IDs for vehicle icons
174164
private val automotiveIcons = intArrayOf(
175165
R.drawable.vehicle_car,
@@ -187,7 +177,7 @@ class TextureQuadExampleActivity: GeneralGlobeActivity() {
187177
/**
188178
* Helper method to create vehicle placemarks.
189179
*/
190-
private fun createAutomobilePlacemark(location: Location, name: String, automotiveType: String, textureQuad : TextureQuad, vertexIndex : Int) =
180+
private fun createAutomobilePlacemark(location: Location, automotiveType: String, textureQuad : TextureQuad, vertexIndex : Int) =
191181
automotiveIconMap[automotiveType]?.let { resId ->
192182
createWithImage(Position(location.latitude, location.longitude, 0.0), fromResource(resId)).apply {
193183
attributes.apply {
@@ -198,7 +188,7 @@ class TextureQuadExampleActivity: GeneralGlobeActivity() {
198188
imageScale = HIGHLIGHTED_IMAGE_SCALE
199189
imageColor = Color(android.graphics.Color.YELLOW)
200190
}
201-
displayName = name
191+
202192
altitudeMode = AltitudeMode.CLAMP_TO_GROUND
203193
// The AUTOMOTIVE_TYPE property is used to exchange the vehicle type with the VehicleTypeDialog
204194
putUserProperty(AUTOMOTIVE_TYPE, automotiveType)
@@ -215,20 +205,21 @@ class TextureQuadExampleActivity: GeneralGlobeActivity() {
215205
bottomRight: Location,
216206
topRight : Location,
217207
topLeft : Location,
218-
imageSource: ImageSource) : List<Renderable>
208+
imageSource: ImageSource,
209+
drawOutline: Boolean = true) : List<Renderable>
219210
{
220211
val textureQuad = TextureQuad(bottomLeft, bottomRight, topRight, topLeft,
221212
ShapeAttributes().apply {
222213
interiorImageSource = imageSource
223-
isDrawOutline = true
214+
isDrawOutline = drawOutline
224215
outlineWidth = 3.0f
225216
outlineColor = Color(1.0f, 0.0f, 0.0f, 1f)
226217
})
227218
return listOf(
228-
createAutomobilePlacemark(bottomLeft, "Civilian Vehicle", automotiveTypes[1], textureQuad, 0),
229-
createAutomobilePlacemark(bottomRight, "Civilian Vehicle", automotiveTypes[1], textureQuad, 1),
230-
createAutomobilePlacemark(topRight, "Civilian Vehicle", automotiveTypes[1], textureQuad, 2),
231-
createAutomobilePlacemark(topLeft, "Civilian Vehicle", automotiveTypes[1], textureQuad, 3),
219+
createAutomobilePlacemark(bottomLeft, automotiveTypes[1], textureQuad, 0),
220+
createAutomobilePlacemark(bottomRight, automotiveTypes[1], textureQuad, 1),
221+
createAutomobilePlacemark(topRight, automotiveTypes[1], textureQuad, 2),
222+
createAutomobilePlacemark(topLeft, automotiveTypes[1], textureQuad, 3),
232223
textureQuad
233224
)
234225
}

0 commit comments

Comments
 (0)