Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This repository provides a collection of sample applications to help you get sta
* **[Maps3DSamples/ComposeDemos](Maps3DSamples/ComposeDemos/app/README.md)**: Modern, declarative Jetpack Compose samples built with the `maps3d-compose` library.
* **[Maps3DSamples/ApiDemos](Maps3DSamples/ApiDemos)**: Showcases fundamental and advanced API features using traditional Android Views in both **[Kotlin](Maps3DSamples/ApiDemos/kotlin-app/README.md)** and **[Java](Maps3DSamples/ApiDemos/java-app/README.md)**.
* **[PlacesUIKit3D](PlacesUIKit3D/README.md)**: Demonstrates integrating the Places UI Kit (Place Search, Place Autocomplete, and Place Details) with the Maps 3D SDK.
* **[codelab](codelab/codelab.md)**: **Aloha Explorer** step-by-step codelab (`starter` and `solution` projects) covering 3D camera flights, altitude modes, custom markers, extruded 3D polygons, geodesic polylines, glTF models, popovers, and Jetpack Compose interop.
* **[Maps3DSamples/advanced](Maps3DSamples/advanced)**: Demonstrates View-interop patterns for bridging `Map3DView` with Jetpack Compose and `ViewModel`.
* **[snippets](snippets)**: A collection of standalone, extraction-ready code snippets demonstrating standard integration endpoints in both Kotlin and Java. Includes a coordinate checklist mapping tracker listed in [CATALOG.md](snippets/CATALOG.md).

Expand Down
677 changes: 416 additions & 261 deletions codelab/codelab.md

Large diffs are not rendered by default.

Binary file added codelab/images/balloon_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/compose_integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/custom_markers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/extruded_palace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/fly_to_honolulu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/four_markers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/global_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/polylines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/popover_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codelab/images/scenic_tour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions codelab/solution/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,43 @@ kotlin {
}

dependencies {
// Core AndroidX Activity and edge-to-edge window support
implementation(libs.androidx.activity)
// Jetpack Compose integration for ComponentActivity (setContent)
implementation(libs.androidx.activity.compose)
// AppCompat support for traditional Android Views (AppCompatActivity)
implementation(libs.androidx.appcompat)
// ConstraintLayout for positioning the 3D map and bottom control bar
implementation(libs.androidx.constraintlayout)
// Kotlin extensions for core Android framework APIs
implementation(libs.androidx.core.ktx)
// Lifecycle-aware coroutine scopes (lifecycleScope) and DefaultLifecycleObserver
implementation(libs.androidx.lifecycle.runtime.ktx)
// Material Design 3 components for Jetpack Compose
implementation(libs.androidx.material3)
// Core Jetpack Compose UI primitives and AndroidView interop
implementation(libs.androidx.ui)
// Jetpack Compose graphics and color utilities
implementation(libs.androidx.ui.graphics)
// Android Studio preview support for @Composable functions
implementation(libs.androidx.ui.tooling.preview)
// Material Design components for Android Views
implementation(libs.material)
// Compose Bill of Materials (BOM) to align Compose library versions
implementation(platform(libs.androidx.compose.bom))

// Compose UI inspection and tooling in debug builds
debugImplementation(libs.androidx.ui.tooling)

// JUnit 4 framework for local JVM unit tests
testImplementation(libs.junit)

// AndroidX JUnit runner extensions for instrumented tests
androidTestImplementation(libs.androidx.junit)
// Espresso UI testing framework for instrumented tests
androidTestImplementation(libs.androidx.espresso.core)

// Google Play Services Maps 3D SDK for 3D map rendering, camera animations, markers, polygons, and glTF models
implementation(libs.play.services.maps3d)
}

Expand All @@ -77,11 +94,3 @@ secrets {
// checked in version control.
defaultPropertiesFileName = "local.defaults.properties"
}

tasks.register<Exec>("launchDebug") {
dependsOn("installDebug")
commandLine("adb", "shell", "am", "start", "-n", "com.example.alohaexplorer/.MainActivity")
doLast {
println("Launched com.example.alohaexplorer/.MainActivity")
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.example.alohaexplorer

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.alohaexplorer", appContext.packageName)
}
}
}
8 changes: 5 additions & 3 deletions codelab/solution/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<!-- Step 1: Internet Permission is required for loading tiles and models -->
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand All @@ -15,22 +17,22 @@

<meta-data
android:name="com.google.android.geo.maps3d.API_KEY"
android:value="${MAPS3D_API_KEY}"
/>
android:value="${MAPS3D_API_KEY}" />

<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".Map3DComposeActivity"
android:exported="true"
android:label="Aloha Compose" />
android:label="@string/title_activity_compose" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ val KOKO_HEAD = latLngAltitude {
}

val PEARL_HARBOR = latLngAltitude {
latitude = 21.31861
longitude = -157.92250
latitude = 21.3649
longitude = -157.9500
altitude = 0.0
}

Expand Down Expand Up @@ -105,6 +105,17 @@ val CUSTOM_MARKER_CAMERA = camera {
this.range = 1399.0
}

val POLYLINE_CAMERA = camera {
center = latLngAltitude {
latitude = 21.2917
longitude = -157.8437
altitude = 0.0
}
tilt = 55.0
range = 5500.0
heading = 35.0
}

val BALLOON_CAMERA = camera {
center = WAIKIKI
tilt = 60.0
Expand Down
Loading
Loading