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
8 changes: 4 additions & 4 deletions Maps3DSamples/ApiDemos/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ android {
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
}
Expand All @@ -80,7 +80,7 @@ dependencies {

api(libs.play.services.base) // "com.google.android.gms:play-services-base:18.10.0"
api(libs.play.services.maps3d) // "com.google.android.gms:play-services-maps3d:0.2.2"
api(libs.maps.utils.ktx)
api(libs.android.maps.utils)
}

jacoco {
Expand Down
4 changes: 2 additions & 2 deletions Maps3DSamples/ApiDemos/java-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ android {
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
buildConfig = true
Expand Down
6 changes: 3 additions & 3 deletions Maps3DSamples/ApiDemos/kotlin-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ android {
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
buildFeatures {
Expand Down
16 changes: 11 additions & 5 deletions Maps3DSamples/ComposeDemos/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ plugins {
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
ktlint().editorConfigOverride(mapOf("indent_size" to "4", "ktlint_function_naming_ignore_when_annotated_with" to "Composable"))
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "4",
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
"ktlint_standard_max-line-length" to "disabled",
),
)
trimTrailingWhitespace()
endWithNewline()
}
Expand Down Expand Up @@ -60,12 +66,12 @@ android {
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
buildFeatures {
Expand Down Expand Up @@ -101,7 +107,7 @@ dependencies {
implementation(libs.androidx.fragment.ktx)

// Maps Utils
implementation(libs.maps.utils.ktx)
implementation(libs.android.maps.utils)

// Material Icons Extended
implementation(libs.androidx.material.icons.extended)
Expand Down
8 changes: 4 additions & 4 deletions Maps3DSamples/advanced/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
buildFeatures {
Expand Down Expand Up @@ -104,7 +104,7 @@ dependencies {
testImplementation(libs.google.truth)

// Google Maps Utils for the polyline decoder
implementation(libs.maps.utils.ktx)
implementation(libs.android.maps.utils)

implementation(libs.ktor.client.core)
implementation(libs.ktor.client.cio)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package com.example.advancedmaps3dsamples.scenarios

import com.example.advancedmaps3dsamples.R
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.ktx.utils.latLngListEncode
import com.google.maps.android.latLngListEncode

const val PLANE_URL = "https://storage.googleapis.com/gmp-maps-demos/p3d-map/assets/Airplane.glb"
const val PLANE_SCALE = 0.05
Expand Down
2 changes: 1 addition & 1 deletion PlacesUIKit3D/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ dependencies {
// These are the essential libraries for this sample, providing Maps and Places functionality.
implementation(libs.play.services.maps3d) // The core SDK for embedding 3D Google Maps.
implementation(libs.places) // The SDK for the Places UI Kit (PlaceDetails fragments).
implementation(libs.maps.utils.ktx) // Google Maps Utils for polyline decoding and other utilities.
implementation(libs.android.maps.utils) // Google Maps Utils for polyline decoding and other utilities.

// --- Dependency Injection ---
// Hilt is used for managing dependencies and object lifecycles.
Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kotlinxSerialization = "1.11.0"
ktor = "3.5.2"
hilt = "2.60.1"
ksp = "2.3.6"
mapsUtilsKtx = "6.3.0"
mapsUtils = "6.0.0-rc01"
androidx-core-ktx = "1.8.9"
androidxArchCoreTesting = "2.2.0"
kotlinxCoroutines = "1.8.0"
Expand Down Expand Up @@ -81,7 +81,8 @@ ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
maps-utils-ktx = { module = "com.google.maps.android:maps-utils-ktx", version.ref = "mapsUtilsKtx" }
android-maps-utils = { module = "com.google.maps.android:android-maps-utils", version.ref = "mapsUtils" }
android-maps-utils-core = { module = "com.google.maps.android:android-maps-utils-core", version.ref = "mapsUtils" }
androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" }

[plugins]
Expand Down
14 changes: 10 additions & 4 deletions maps3d-compose-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ plugins {
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
ktlint().editorConfigOverride(mapOf("indent_size" to "4", "ktlint_function_naming_ignore_when_annotated_with" to "Composable"))
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "4",
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
"ktlint_standard_max-line-length" to "disabled",
),
)
trimTrailingWhitespace()
endWithNewline()
}
Expand Down Expand Up @@ -58,12 +64,12 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
buildFeatures {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ abstract class BaseVisualTest {
key
}

protected fun captureScreenshot(filename: String = "screenshot_${System.currentTimeMillis()}.png"): Bitmap {
protected fun captureScreenshot(
filename: String = "screenshot_${System.currentTimeMillis()}.png",
): Bitmap {
val screenshotFile = File(context.getExternalFilesDir(null), filename)
val screenshotTaken = uiDevice.takeScreenshot(screenshotFile)
assertTrue("Failed to take screenshot: $filename", screenshotTaken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ class Maps3DVisualTest : BaseVisualTest() {

// Parse JSON and click
try {
val jsonStr = geminiResponse?.substringAfter("{")?.substringBeforeLast("}")?.let { "{$it}" } ?: ""
val jsonStr =
geminiResponse?.substringAfter("{")?.substringBeforeLast("}")?.let { "{$it}" }
?: ""
val json = org.json.JSONObject(jsonStr)
val x = json.getDouble("x")
val y = json.getDouble("y")
Expand All @@ -418,7 +420,9 @@ class Maps3DVisualTest : BaseVisualTest() {

uiDevice.click(clickX, clickY)
} catch (e: Exception) {
org.junit.Assert.fail("Failed to parse coordinates from Gemini response: $geminiResponse. Error: ${e.message}")
org.junit.Assert.fail(
"Failed to parse coordinates from Gemini response: $geminiResponse. Error: ${e.message}",
)
}

// Wait for UI to update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ fun MapInteractionsScreen() {
map3dInstance = instance
// Set up click listener directly on the instance
instance.setMap3DClickListener { location, placeId ->
Log.d("MapInteractionsActivity", "Map clicked at ${location.latitude}, ${location.longitude}")
Log.d(
"MapInteractionsActivity",
"Map clicked at ${location.latitude}, ${location.longitude}",
)
clickedInfo = if (placeId != null) {
"Clicked Place ID: $placeId\nAt: ${location.latitude}, ${location.longitude}"
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@ fun TiltScale(tilt: Float, modifier: Modifier = Modifier) {
)

if (isMajor) {
val measuredText = textMeasurer.measure(i.toString(), style = TextStyle(color = onPrimaryColor, fontSize = 12.sp))
val measuredText = textMeasurer.measure(
i.toString(),
style = TextStyle(color = onPrimaryColor, fontSize = 12.sp),
)
drawText(
textLayoutResult = measuredText,
topLeft = Offset(centerLineX + 20f, yPos - measuredText.size.height / 2f),
topLeft = Offset(
centerLineX + 20f,
yPos - measuredText.size.height / 2f,
),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ fun WhiskeyCompass(

showDegreeLabels: Boolean = true,
degreeLabelInterval: Int = 15,
degreeLabelTextStyle: TextStyle = MaterialTheme.typography.labelSmall.copy(textAlign = TextAlign.Center),
degreeLabelTextStyle: TextStyle = MaterialTheme.typography.labelSmall.copy(
textAlign = TextAlign.Center,
),
degreeLabelVerticalOffset: Dp = 4.dp,

showCardinalLabels: Boolean = true,
Expand Down Expand Up @@ -142,7 +144,9 @@ fun WhiskeyCompass(
val absoluteDegree = repetitionBaseDegree + degreeInRepetition
val xPos = absoluteDegree * pixelsPerDegree

if (xPos < -xOffset + canvasWidth + canvasWidth && xPos > -xOffset - canvasWidth) {
if (xPos < -xOffset + canvasWidth + canvasWidth &&
xPos > -xOffset - canvasWidth
) {
val isMajorTickEquivalent = degreeInRepetition % 10 == 0
val isMinorTickEquivalent =
degreeInRepetition % 5 == 0 && !isMajorTickEquivalent
Expand All @@ -167,7 +171,9 @@ fun WhiskeyCompass(
textLayoutResult = measuredText,
topLeft = Offset(
x = xPos - measuredText.size.width / 2f,
y = tickTopY - measuredText.size.height - cardinalLabelVerticalOffsetPx,
y =
tickTopY - measuredText.size.height -
cardinalLabelVerticalOffsetPx,
),
)
}
Expand Down Expand Up @@ -272,7 +278,9 @@ private fun FlatWhiskeyCompassPreview() {
lubberLineColor = Color(0xFFFFD600),
pixelsPerDegree = 12f,
degreeLabelInterval = 10,
degreeLabelTextStyle = MaterialTheme.typography.bodySmall.copy(color = Color(0xFF81D4FA)),
degreeLabelTextStyle = MaterialTheme.typography.bodySmall.copy(
color = Color(0xFF81D4FA),
),
cardinalLabelTextStyle = MaterialTheme.typography.labelLarge.copy(
color = Color.White,
fontWeight = FontWeight.Bold,
Expand Down
16 changes: 11 additions & 5 deletions maps3d-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ plugins {
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
ktlint().editorConfigOverride(mapOf("indent_size" to "4", "ktlint_function_naming_ignore_when_annotated_with" to "Composable"))
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "4",
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
"ktlint_standard_max-line-length" to "disabled",
),
)
trimTrailingWhitespace()
endWithNewline()
}
Expand All @@ -40,12 +46,12 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
buildFeatures {
Expand All @@ -66,7 +72,7 @@ dependencies {

// Maps 3D SDK
implementation(libs.play.services.maps3d)
implementation(libs.maps.utils.ktx)
implementation(libs.android.maps.utils)

testImplementation(libs.junit)
testImplementation(libs.robolectric)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fun GoogleMap3D(
minTilt = 0.0,
maxTilt = 90.0,
bounds = null,
mapMode = Map3DMode.SATELLITE, // using the class from com.google.android.gms.maps3d.model.Map3DMode
mapMode = Map3DMode.SATELLITE,
mapId = null,
minAltitude = 0.0,
maxAltitude = 1000000.0,
Expand Down Expand Up @@ -129,7 +129,10 @@ fun GoogleMap3D(

if (currentOnMapClick != null || currentOnPlaceClick != null) {
googleMap3D.setMap3DClickListener { location, placeId ->
android.util.Log.d("GoogleMap3D", "Map clicked at $location, placeId: $placeId")
android.util.Log.d(
"GoogleMap3D",
"Map clicked at $location, placeId: $placeId",
)
if (placeId != null) {
currentOnPlaceClick?.invoke(placeId)
} else {
Expand Down
Loading
Loading