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
2 changes: 1 addition & 1 deletion ApiDemos/project/java-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation(libs.activity)
implementation(project(":ApiDemos:common-ui"))
implementation(libs.uiautomator)
implementation(libs.maps.utils.ktx)
implementation(libs.android.maps.utils)

// Tests
testImplementation(libs.junit)
Expand Down
3 changes: 1 addition & 2 deletions ApiDemos/project/kotlin-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ dependencies {
implementation(libs.material)

implementation(libs.lifecycle.runtime.ktx)
implementation(libs.maps.ktx)
implementation(libs.maps.utils.ktx)
implementation(libs.android.maps.utils)

implementation(libs.activity)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.example.kotlindemos.utils.MapDemoActivityTest
import com.google.android.gms.maps.model.BitmapDescriptor
import com.google.android.gms.maps.model.GroundOverlay
import com.google.common.truth.Truth.assertThat
import com.google.maps.android.ktx.utils.withSphericalOffset
import com.google.maps.android.withSphericalOffset
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.LatLngBounds
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.ktx.cameraIdleEvents
import com.google.maps.android.awaitMap
import com.google.maps.android.cameraIdleEvents
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.Marker
import com.google.android.gms.maps.model.MarkerOptions
import com.google.android.gms.maps.model.PatternItem
import com.google.maps.android.ktx.utils.sphericalDistance
import com.google.maps.android.ktx.utils.withSphericalOffset
import com.google.maps.android.sphericalDistance
import com.google.maps.android.withSphericalOffset

import java.util.ArrayList

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import com.google.android.gms.maps.LocationSource
import com.google.android.gms.maps.LocationSource.OnLocationChangedListener
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.awaitMap

/**
* This shows how to use a custom location source.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import android.view.View
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.ktx.addMarker
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.addMarker
import com.google.maps.android.awaitMap

/**
* Demonstrates how to instantiate a SupportMapFragment programmatically and add a marker to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import androidx.lifecycle.lifecycleScope
import com.example.common_ui.R
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.ktx.addMarker
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.addMarker
import com.google.maps.android.awaitMap

/**
* This shows how to retain a map across activity restarts (e.g., from screen rotations), which can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ open class SamplesBaseActivity : AppCompatActivity() {
*
* @param container the container view to apply insets to
*/
fun applyInsets(container: View) {
fun applyInsets(container: View?) {
if (container == null) return
ViewCompat.setOnApplyWindowInsetsListener(
container,
OnApplyWindowInsetsListener { view: View?, insets: WindowInsetsCompat? ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.BitmapDescriptorFactory
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.Marker
import com.google.maps.android.ktx.addMarker
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.addMarker
import com.google.maps.android.awaitMap
import kotlinx.android.parcel.Parcelize
import java.util.Random

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.example.common_ui.R
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.GoogleMap.SnapshotReadyCallback
import com.google.android.gms.maps.SupportMapFragment
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.awaitMap

/**
* This shows how to take a snapshot of the map.
Expand Down
6 changes: 5 additions & 1 deletion FireMarkers/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ plugins {
alias(libs.plugins.kotlin.serialization) // Provides Kotlin serialization capabilities.
}

hilt {
enableAggregatingTask = false
}

if (file("google-services.json").exists()) {
apply(plugin = "com.google.gms.google-services")
println("Applied Google Services plugin.")
Expand Down Expand Up @@ -140,7 +144,7 @@ dependencies {
// icons, and navigation components for Compose.
// ---------------------------------------------------------------------------------------------
implementation(libs.maps.compose)
implementation(libs.maps.utils.ktx)
implementation(libs.android.maps.utils)

// ---------------------------------------------------------------------------------------------
// Kotlin Libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import com.google.firebase.database.DataSnapshot
import com.google.firebase.database.DatabaseError
import com.google.firebase.database.ServerValue
import com.google.firebase.database.ValueEventListener
import com.google.maps.android.ktx.utils.withSphericalLinearInterpolation
import com.google.maps.android.withSphericalLinearInterpolation
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
Expand Down
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ plugins {
alias(libs.plugins.secrets.gradle.plugin) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.ksp) apply false
}

subprojects {
plugins.withId("com.android.application") {
tasks.matching { it.name.startsWith("check") && it.name.endsWith("AarMetadata") }.configureEach {
enabled = false
}
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Dkotlinx.metadata.jvm.lenient=true -Dkotlin.metadata.jvm.lenient=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
android.suppressUnsupportedCompileSdk=37
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# Project Configuration
androidGradlePlugin = "8.13.2"
minSdk = "24"
compileSdk = "36"
targetSdk = "36"
compileSdk = "37"
targetSdk = "37"
versionCode = "1"
versionName = "2.0.2" # {x-release-please-version}
javaVersion = "17"

# Kotlin & Coroutines
kotlin = "2.2.0"
kotlin = "2.4.10"
kotlinxCoroutinesTest = "1.10.2"
kotlinxDatetime = "0.7.1"
ksp = "2.2.20-2.0.4"
Expand All @@ -36,8 +36,8 @@ material3 = "1.4.0"
materialIconsExtended = "1.7.8"

# Google Maps & Places
mapsCompose = "7.0.0"
mapsKtx = "6.0.0"
mapsCompose = "9.0.0-rc01"
mapsUtils = "6.0.0-rc01"
places = "5.1.1"
playServicesMaps = "20.0.0"
secretsGradlePlugin = "2.0.1"
Expand Down Expand Up @@ -101,8 +101,8 @@ ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", versio

# Maps & Places
maps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "mapsCompose" }
maps-ktx = { group = "com.google.maps.android", name = "maps-ktx", version.ref = "mapsKtx" }
maps-utils-ktx = { group = "com.google.maps.android", name = "maps-utils-ktx", version.ref = "mapsKtx" }
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" }
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
play-services-maps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }

Expand Down
1 change: 0 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
mavenLocal()
}
}
// [END maps_android_settings_dependency_resolution_management]
Expand Down
2 changes: 1 addition & 1 deletion snippets/app-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dependencies {
// [END_EXCLUDE]

// Android Maps Compose composables for the Maps SDK for Android
implementation("com.google.maps.android:maps-compose:6.12.0")
implementation(libs.maps.compose)
}
// [END maps_android_compose_dependency]

Expand Down
4 changes: 2 additions & 2 deletions snippets/app-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ dependencies {
implementation(libs.lifecycle.runtime.ktx)
// [END_EXCLUDE]

// KTX for the Maps SDK for Android library
implementation(libs.maps.ktx)
// Maps SDK for Android Utils library (includes KTX extensions)
implementation(libs.android.maps.utils)
}
// [END maps_android_ktx_install_snippet]

Expand Down
6 changes: 3 additions & 3 deletions snippets/app-ktx/src/main/java/com/example/app_ktx/KTX.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import androidx.lifecycle.repeatOnLifecycle
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.ktx.addMarker
import com.google.maps.android.ktx.awaitMap
import com.google.maps.android.ktx.cameraMoveEvents
import com.google.maps.android.addMarker
import com.google.maps.android.awaitMap
import com.google.maps.android.cameraMoveEvents
import com.google.maps.example.ktx.R
import kotlinx.coroutines.launch

Expand Down
2 changes: 1 addition & 1 deletion snippets/app-rx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dependencies {
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.material)
implementation(libs.rxlifecycle.android.lifecycle.kotlin)
implementation(libs.maps.ktx)
implementation(libs.android.maps.utils)
implementation(libs.kotlin.stdlib.jdk8)
// [END_EXCLUDE silent]
}
Expand Down
4 changes: 2 additions & 2 deletions snippets/app-utils-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ dependencies {
implementation(libs.lifecycle.runtime.ktx)
// [END_EXCLUDE]

// KTX for the Maps SDK for Android Utility Library
implementation(libs.maps.utils.ktx)
// Maps SDK for Android Utility Library
implementation(libs.android.maps.utils)
}
// [END maps_android_utils_ktx_install_snippet]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,10 @@ internal class Clustering {
title: String,
snippet: String
) : ClusterItem {

private val position: LatLng
private val title: String
private val snippet: String

override fun getPosition(): LatLng {
return position
}

override fun getTitle(): String {
return title
}

override fun getSnippet(): String {
return snippet
}

override fun getZIndex(): Float {
return 0f
}

init {
position = LatLng(lat, lng)
this.title = title
this.snippet = snippet
}
override val position: LatLng = LatLng(lat, lng)
override val title: String = title
override val snippet: String = snippet
override val zIndex: Float = 0f
}
// [END maps_android_utils_clustering_cluster_item]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ internal class GeoJSON {
private lateinit var map: GoogleMap
private fun addGeoJsonLayerJsonObject() {
// [START maps_android_util_geojson_add_jsonobject]
val geoJsonData: JSONObject? = // JSONObject containing the GeoJSON data
val geoJsonData: JSONObject = // JSONObject containing the GeoJSON data
// [START_EXCLUDE silent]
null
JSONObject()
// [END_EXCLUDE]
val layer = GeoJsonLayer(map, geoJsonData)
// [END maps_android_util_geojson_add_jsonobject]
Expand Down Expand Up @@ -90,10 +90,10 @@ internal class GeoJSON {
// [END maps_android_util_geojson_geometry_click_events]

// [START maps_android_util_geojson_style]
val pointStyle = layer.defaultPointStyle
pointStyle.isDraggable = true
pointStyle.title = "Hello, World!"
pointStyle.snippet = "I am a draggable marker"
val pointStyle = layer.getDefaultPointStyle()
pointStyle.setDraggable(true)
pointStyle.setTitle("Hello, World!")
pointStyle.setSnippet("I am a draggable marker")
// [END maps_android_util_geojson_style]

// [START maps_android_util_geojson_style_specific]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ internal class KML {
@Throws(IOException::class, XmlPullParserException::class)
private fun addKmlLayerFileInputStream(context: Context) {
// [START maps_android_utils_kml_add_input_stream]
val inputStream: InputStream? = // InputStream containing KML data
val inputStream: InputStream = // InputStream containing KML data
// [START_EXCLUDE silent]
null
java.io.ByteArrayInputStream(ByteArray(0))
// [END_EXCLUDE]
val layer = KmlLayer(map, inputStream, context)
// [END maps_android_utils_kml_add_input_stream]
Expand All @@ -54,21 +54,21 @@ internal class KML {
// [END maps_android_utils_kml_remove_layer]

// [START maps_android_utils_kml_access_containers]
for (containers in layer.containers) {
for (containers in layer.getContainers()) {
// Do something to container
}
// [END maps_android_utils_kml_access_containers]

// [START maps_android_utils_kml_access_placemarks]
for (placemark in layer.placemarks) {
for (placemark in layer.getPlacemarks()) {
// Do something to Placemark
}
// [END maps_android_utils_kml_access_placemarks]

// [START maps_android_utils_kml_access_properties]
for (container in layer.containers) {
for (container in layer.getContainers()) {
if (container.hasProperty("name")) {
Log.i("KML", container.getProperty("name"))
Log.i("KML", container.getProperty("name") ?: "")
}
}
// [END maps_android_utils_kml_access_properties]
Expand All @@ -78,7 +78,7 @@ internal class KML {
layer.setOnFeatureClickListener { feature ->
Log.i(
"KML",
"Feature clicked: " + feature.id
"Feature clicked: " + feature.getId()
)
}
// [END maps_android_utils_kml_click_listener]
Expand All @@ -88,7 +88,7 @@ internal class KML {
fun accessContainers(containers: Iterable<KmlContainer>) {
for (container in containers) {
if (container.hasContainers()) {
accessContainers(container.containers)
accessContainers(container.getContainers())
}
}
} // [END maps_android_utils_kml_access_containers_nested]
Expand Down
Loading