Skip to content

Commit 05d5153

Browse files
authored
feat: Update maps SDK to 0.0.2 (#11)
Update the following library versions: - Android Gradle Plugin (AGP) - Lifecycle Runtime KTX - Compose BOM - Play Services Maps 3D - `id` attribute is now supported for markers
1 parent fa4e9fb commit 05d5153

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

Maps3DSamples/ApiDemos/gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[versions]
2-
agp = "8.9.2"
2+
agp = "8.10.1"
33
desugar_jdk_libs = "2.1.5"
44
kotlin = "2.0.21"
55
coreKtx = "1.16.0"
66
junit = "4.13.2"
77
junitVersion = "1.2.1"
88
espressoCore = "3.6.1"
9-
appcompat = "1.7.0"
9+
appcompat = "1.7.1"
1010
material = "1.12.0"
11-
lifecycleRuntimeKtx = "2.9.0"
11+
lifecycleRuntimeKtx = "2.9.1"
1212
activityCompose = "1.10.1"
13-
composeBom = "2025.05.00"
14-
playServicesMaps3d = "0.0.1"
13+
composeBom = "2025.06.00"
14+
playServicesMaps3d = "0.0.2"
1515
secretsGradlePlugin = "2.0.1"
1616

1717
[libraries]

Maps3DSamples/ApiDemos/kotlin-app/src/main/java/com/example/maps3dkotlin/markers/MarkersActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class MarkersActivity : SampleBaseActivity() {
5252

5353
// Marker 1: Absolute
5454
googleMap3D.addMarker(markerOptions {
55+
id = "marker_one"
5556
position = latLngAltitude {
5657
latitude = 52.519605780912585
5758
longitude = 13.406867190588198
@@ -70,6 +71,7 @@ class MarkersActivity : SampleBaseActivity() {
7071

7172
// Marker 2: Relative to Ground
7273
googleMap3D.addMarker(markerOptions {
74+
id = "relative_to_ground"
7375
position = latLngAltitude {
7476
latitude = 52.519882191069016
7577
longitude = 13.407410777254293
@@ -89,6 +91,7 @@ class MarkersActivity : SampleBaseActivity() {
8991

9092
// Marker 3: Clamped to Ground
9193
googleMap3D.addMarker(markerOptions {
94+
id = "clamped_to_ground"
9295
position = latLngAltitude {
9396
latitude = 52.52027645136134
9497
longitude = 13.408271658592406
@@ -107,6 +110,7 @@ class MarkersActivity : SampleBaseActivity() {
107110

108111
// Marker 4: Relative to Mesh
109112
googleMap3D.addMarker(markerOptions {
113+
// With no id, one will be provided automatically
110114
position = latLngAltitude {
111115
latitude = 52.520835071144226
112116
longitude = 13.409426847943774

Maps3DSamples/advanced/app/src/main/java/com/example/advancedmaps3dsamples/scenarios/ScenarioData.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ val scenarios =
300300
"flyTo=lat=52.522255,lng=13.405010,alt=84.0,hdg=312.8,tilt=66,range=1621,dur=2000;" +
301301
"delay=dur=3000",
302302
markers =
303-
"lat=52.519605780912585,lng=13.406867190588198,alt=150,label= ,altMode=absolute;" +
304-
"lat=52.519882191069016,lng=13.407410777254293,alt=50,label= ,altMode=relative_to_ground;" +
305-
"lat=52.52027645136134,lng=13.408271658592406,alt=5,label= ,altMode=clamp_to_ground;" +
306-
"lat=52.520835071144226,lng=13.409426847943774,alt=10,label= ,altMode=relative_to_mesh;"
303+
"id=absolute,lat=52.519605780912585,lng=13.406867190588198,alt=150,label= ,altMode=absolute;" +
304+
"id=relative_to_ground,lat=52.519882191069016,lng=13.407410777254293,alt=50,label= ,altMode=relative_to_ground;" +
305+
"id=clamp_to_ground,lat=52.52027645136134,lng=13.408271658592406,alt=5,label= ,altMode=clamp_to_ground;" +
306+
"id=relative_to_mesh,lat=52.520835071144226,lng=13.409426847943774,alt=10,label= ,altMode=relative_to_mesh;"
307307
),
308308
createScenario(
309309
name = "model",

Maps3DSamples/advanced/app/src/main/java/com/example/advancedmaps3dsamples/scenarios/ScenarioMapper.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ fun Map<String, String>.getInt(key: String, default: Int = 0): Int {
8686
}
8787

8888
/** Helper to safely get a String value from the attributes map. */
89-
fun Map<String, String>.getString(key: String, default: String = ""): String {
90-
return this[key] ?: default
91-
}
89+
fun Map<String, String>.getString(key: String, default: String = ""): String = this[key] ?: default
9290

9391
// --- Object Converters ---
9492

@@ -242,9 +240,13 @@ fun String.toMarkers(): List<MarkerOptions> {
242240
}
243241
return markersString.split(";").mapNotNull { markerStr ->
244242
val attributes = markerStr.toAttributesMap()
243+
val markerId = attributes["id"]
245244
// Basic validation: requires lat, lng
246245
if (attributes.containsKey("lat") && attributes.containsKey("lng")) {
247246
markerOptions {
247+
if (markerId != null) {
248+
id = markerId
249+
}
248250
collisionBehavior = CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL
249251
position = attributes.toLatLngAltitude()
250252
isExtruded = true

Maps3DSamples/advanced/gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[versions]
2-
agp = "8.10.0"
2+
agp = "8.10.1"
33
kotlin = "2.1.10"
44
kotlinxDatetime = "0.3.2"
55
coreKtx = "1.16.0"
66
junit = "4.13.2"
77
junitVersion = "1.2.1"
88
espressoCore = "3.6.1"
9-
lifecycleRuntimeKtx = "2.9.0"
9+
lifecycleRuntimeKtx = "2.9.1"
1010
activityCompose = "1.10.1"
11-
composeBom = "2025.05.00"
11+
composeBom = "2025.06.00"
1212

1313
hilt = "2.55"
1414
ksp = "2.1.10-1.0.30"
15-
playServicesMaps3d = "0.0.1"
15+
playServicesMaps3d = "0.0.2"
1616
secretsGradlePlugin = "2.0.1"
1717
truth = "1.4.4"
1818
mapsUtilsKtx = "5.2.0"

0 commit comments

Comments
 (0)