Skip to content

Commit

Permalink
Merge branch 'googlemaps:main' into set-initial-map-padding
Browse files Browse the repository at this point in the history
  • Loading branch information
kkris authored Aug 1, 2023
2 parents 951ea34 + 2422f06 commit b3030b1
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/instrumentation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
distribution: 'adopt'

- name: Inject Maps API Key
run: |
echo MAPS_API_KEY=$MAPS_API_KEY >> ./local.properties
env:
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
run: |
[ -z "$MAPS_API_KEY" ] && MAPS_API_KEY="YOUR_API_KEY"; echo "MAPS_API_KEY=$MAPS_API_KEY" >> ./local.properties
- name: Build debug
run: ./gradlew assembleDebug
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,20 @@ jobs:
GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
SONATYPE_PASSWORD: ${{ secrets.SYNCED_SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SYNCED_SONATYPE_USERNAME }}

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v3.4.1
with:
extra_plugins: |
"@semantic-release/commit-analyzer"
"@semantic-release/release-notes-generator"
"@google/semantic-release-replace-plugin"
"@semantic-release/exec"
"@semantic-release/git
"@semantic-release/github
"@semantic-release/commit-analyzer@8.0.1"
"@semantic-release/release-notes-generator@9.0.3"
"@google/semantic-release-replace-plugin@1.2.0"
"@semantic-release/exec@5.0.0"
"@semantic-release/git@9.0.1"
"@semantic-release/github@7.2.3"
env:
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
pull_request:
branches-ignore: ['gh-pages']
workflow_dispatch:
workflow_call:

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins:
to: "version = '${nextRelease.version}'"
- files:
- "README.md"
from: ":[0-9].[0-9].[0-9]"
from: ":([0-9]+).([0-9]+).([0-9]+)"
to: ":${nextRelease.version}"
- - "@semantic-release/exec"
- prepareCmd: "./gradlew build --warn --stacktrace"
Expand Down
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ This repository contains [Jetpack Compose][jetpack-compose] components for the [

```groovy
dependencies {
implementation 'com.google.maps.android:maps-compose:2.11.2'
implementation 'com.google.maps.android:maps-compose:2.12.0'
// Make sure to also include the latest version of the Maps SDK for Android
implementation 'com.google.android.gms:play-services-maps:18.0.2'
// See latest version at https://goo.gle/android-maps-sdk-version
// Optionally, you can include the Compose utils library for Clustering, etc.
implementation 'com.google.maps.android:maps-compose-utils:2.11.2'
implementation 'com.google.maps.android:maps-compose-utils:2.12.0'
// Optionally, you can include the widgets library for ScaleBar, etc.
implementation 'com.google.maps.android:maps-compose-widgets:2.11.2'
implementation 'com.google.maps.android:maps-compose-widgets:2.12.0'
}
```

Expand Down Expand Up @@ -214,7 +214,7 @@ You can add a Street View given a location using the `StreetView` composable.
To use it, provide a `StreetViewPanoramaOptions` object as follows:

```kotlin
val singapore = LatLng(1.35, 103.87)
val singapore = LatLng(1.3588227, 103.8742114)
StreetView(
streetViewPanoramaOptionsFactory = {
StreetViewPanoramaOptions().position(singapore)
Expand Down Expand Up @@ -285,19 +285,31 @@ The [ScaleBarActivity](app/src/main/java/com/google/maps/android/compose/ScaleBa
Both versions of this widget leverage the `CameraPositionState` in `maps-compose` and therefore are very simple to configure with their defaults:

```kotlin
ScaleBar(
modifier = Modifier
Box(Modifier.fillMaxSize()) {

GoogleMap(
modifier = Modifier.fillMaxSize(),
cameraPositionState = cameraPositionState
) {
// ... your map composables ...
}

ScaleBar(
modifier = Modifier
.padding(top = 5.dp, end = 15.dp)
.align(Alignment.TopEnd),
cameraPositionState = cameraPositionState
)
cameraPositionState = cameraPositionState
)

// OR

DisappearingScaleBar(
modifier = Modifier
DisappearingScaleBar(
modifier = Modifier
.padding(top = 5.dp, end = 15.dp)
.align(Alignment.TopStart),
cameraPositionState = cameraPositionState
)
cameraPositionState = cameraPositionState
)
}
```

The colors of the text, line, and shadow are also all configurable (e.g., based on `isSystemInDarkTheme()` on a dark map). Similarly, the `DisappearingScaleBar` animations can be configured.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StreetViewTests {
onClick = onClick
)
}
composeTestRule.waitUntil(8000) {
composeTestRule.waitUntil(10000) {
cameraPositionState.location.position.latitude != 0.0 &&
cameraPositionState.location.position.longitude != 0.0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import kotlinx.coroutines.launch

private const val TAG = "BasicMapActivity"

val singapore = LatLng(1.35, 103.87)
val singapore = LatLng(1.3588227, 103.8742114)
val singapore2 = LatLng(1.40, 103.77)
val singapore3 = LatLng(1.45, 103.77)
val defaultCameraPosition = CameraPosition.fromLatLngZoom(singapore, 11f)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ext.projectArtifactId = { project ->

allprojects {
group = 'com.google.maps.android'
version = '2.11.4'
version = '2.12.0'
project.ext.artifactId = rootProject.ext.projectArtifactId(project)
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v
maps-ktx-std = { module = "com.google.maps.android:maps-ktx", version.ref = "maps" }
maps-ktx-utils = { module = "com.google.maps.android:maps-utils-ktx", version.ref = "maps" }
maps-utils = { module = "com.google.maps.android:android-maps-utils", version.require = "2.3.0" }
maps-playservice = { module = "com.google.android.gms:play-services-maps", version.require = "18.0.2" }
maps-playservice = { module = "com.google.android.gms:play-services-maps", version.require = "18.1.0" }
maps-secrets-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "mapsecrets" }
material = { module = "com.google.android.material:material", version.ref = "material" }
test-junit = { module = "junit:junit", version.ref = "junit" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ internal class ComposeUiClusterRenderer<T : ClusterItem>(
)
view.layout(0, 0, view.measuredWidth, view.measuredHeight)
val bitmap = Bitmap.createBitmap(
view.measuredWidth,
view.measuredHeight,
view.measuredWidth.takeIf { it > 0 } ?: 1,
view.measuredHeight.takeIf { it > 0 } ?: 1,
Bitmap.Config.ARGB_8888
)
bitmap.applyCanvas {
Expand Down

0 comments on commit b3030b1

Please sign in to comment.