From dbe2e9494b7de48decb027c3bee06cda22f2d931 Mon Sep 17 00:00:00 2001 From: masashi Date: Tue, 1 Sep 2026 11:39:41 +0900 Subject: [PATCH 1/4] Make bearing a clockwise map rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bearing を「値を増やすと地図が時計回りに回る」向きに統一し、ネイティブ SDK との変換をコアの CameraBearing に集約する。 --- .../com/mapconductor/googlemaps/MapCameraPosition.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/mapconductor/googlemaps/MapCameraPosition.kt b/src/main/java/com/mapconductor/googlemaps/MapCameraPosition.kt index 2f867cc..c7b2dc2 100644 --- a/src/main/java/com/mapconductor/googlemaps/MapCameraPosition.kt +++ b/src/main/java/com/mapconductor/googlemaps/MapCameraPosition.kt @@ -2,6 +2,7 @@ package com.mapconductor.googlemaps import com.google.android.gms.maps.model.CameraPosition import com.mapconductor.core.features.GeoPoint +import com.mapconductor.core.map.CameraBearing import com.mapconductor.core.map.MapCameraPosition import com.mapconductor.core.map.MapCameraPositionInterface import com.mapconductor.core.map.MapPaddings @@ -22,7 +23,7 @@ fun MapCameraPosition.toCameraPosition(): CameraPosition { .target(GeoPoint.from(position).toLatLng()) .zoom(zoom.toFloat()) .tilt(tilt.coerceIn(0.0, 60.0).toFloat()) - .bearing(bearing.toFloat()) + .bearing(CameraBearing.toNativeHeading(bearing).toFloat()) .build() } else { // tilt < 0: 水平線より abs(tilt) 度上方を向く(仰角ビュー) @@ -33,7 +34,7 @@ fun MapCameraPosition.toCameraPosition(): CameraPosition { val tiltAbsRad = Math.toRadians(tiltAbsDeg) val altitude = converter.zoomLevelToAltitude(zoom, position.latitude, 0.0) val distanceForward = altitude * tan(tiltAbsRad) - val target = Spherical.computeOffset(position, distanceForward, bearing) + val target = Spherical.computeOffset(position, distanceForward, CameraBearing.toNativeHeading(bearing)) val adjustedZoom = converter.altitudeToZoomLevel(altitude / cos(tiltAbsRad), target.latitude, 0.0) return CameraPosition @@ -41,7 +42,7 @@ fun MapCameraPosition.toCameraPosition(): CameraPosition { .target(target.toLatLng()) .zoom(adjustedZoom.toFloat()) .tilt(tiltAbsDeg.toFloat()) - .bearing(bearing.toFloat()) + .bearing(CameraBearing.toNativeHeading(bearing).toFloat()) .build() } } @@ -71,7 +72,7 @@ fun CameraPosition.toMapCameraPosition(paddings: MapPaddingsInterface = MapPaddi return MapCameraPosition( position = position, zoom = zoom.toDouble(), - bearing = bearing.toDouble(), + bearing = CameraBearing.bearingFromNativeHeading(bearing.toDouble()), tilt = tilt.toDouble(), paddings = paddings, visibleRegion = null, From 9138155dda223a25ed3ae95a0fff9106363afdaa Mon Sep 17 00:00:00 2001 From: masashi Date: Thu, 3 Sep 2026 17:12:15 +0900 Subject: [PATCH 2/4] ci: build the core module from the matching branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コアの未マージ/未リリースな変更に追随する PR を、コアが先に取り込まれるのを待たずに検証できるようにする。同名ブランチが無ければ従来どおり既定のコアを使う。 --- .github/workflows/build.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79f872f..f0d3bb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,8 +38,29 @@ jobs: cache: 'gradle' - name: Build core and compose locally + env: + HEAD_REF: ${{ github.head_ref }} run: | - git clone --depth 1 https://github.com/MapConductor/android-sdk-core.git _core + # コア側に PR と同名のブランチがあるなら、そちらを組む。 + # + # ここを default ブランチ固定にしていると、**コアの未マージな変更に追随する + # PR は永久に赤いまま**になる。実際 CameraBearing をコアへ足したとき、 + # プロバイダ側の PR が 10 本まとめて Unresolved reference で落ちた。 + # コアが先にマージされるまで待つ、という運用は取り込み順の事故を呼ぶので、 + # 同名ブランチがあれば拾う形にしてある(無ければ従来どおり default)。 + clone_matching() { + repo="$1"; dir="$2" + url="https://github.com/MapConductor/$repo.git" + if [ -n "$HEAD_REF" ] && git ls-remote --exit-code --heads "$url" "$HEAD_REF" >/dev/null 2>&1; then + echo "$repo: matching branch $HEAD_REF" + git clone --depth 1 --branch "$HEAD_REF" "$url" "$dir" + else + echo "$repo: default branch" + git clone --depth 1 "$url" "$dir" + fi + } + + clone_matching android-sdk-core _core cd _core ./gradlew --no-daemon publishToMavenLocal cd .. @@ -53,7 +74,7 @@ jobs: } EOF - git clone --depth 1 https://github.com/MapConductor/android-sdk-compose.git _compose + clone_matching android-sdk-compose _compose cd _compose ./gradlew --no-daemon publishToMavenLocal cd .. From 8fda9584845db373f124b97f5092a8c5e69a2da4 Mon Sep 17 00:00:00 2001 From: masashi Date: Thu, 3 Sep 2026 20:01:20 +0900 Subject: [PATCH 3/4] fix: point material3 at its own version line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit material3 は compose-ui とは別のバージョン系列で、composeLibs(1.7.8)を流用すると存在しない material3:1.7.8 を要求して sample-app のクラスパスごと解決に失敗する。集約ビルド(android-sdk)の catalog と同じ 1.4.0 に合わせる。 --- gradle/libs.versions.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5e2b5b2..6337dcc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,8 @@ [versions] composeLibs = "1.7.8" +# material3 は compose-ui とは別のバージョン系列。composeLibs(ui 系)を流用すると +# 存在しない material3:1.7.8 を要求してクラスパスごと解決に失敗する。 +material3 = "1.4.0" coroutines = "1.9.0" agp = "9.2.1" kotlin = "2.0.21" @@ -35,7 +38,7 @@ play-services-maps = { module = "com.google.android.gms:play-services-maps", ver # Sample app androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } -androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "composeLibs" } +androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "composeLibs" } # Test From 958ae237fb7c3c81e99d77cf078c20f22656fcfd Mon Sep 17 00:00:00 2001 From: masashi Date: Thu, 3 Sep 2026 20:16:13 +0900 Subject: [PATCH 4/4] fix: declare material-icons-core for the sample app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sample-app が Icons.AutoMirrored を使うが、material3 は material-icons を推移的に持ってこないため単体ビルドで Unresolved reference 'Icons' になる。版は compose BOM 任せで、集約ビルドの catalog と同じ形にする。 --- gradle/libs.versions.toml | 3 +++ sample-app/build.gradle.kts | 1 + 2 files changed, 4 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6337dcc..9b8add3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -39,6 +39,9 @@ play-services-maps = { module = "com.google.android.gms:play-services-maps", ver # Sample app androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" } +# sample-app が Icons.AutoMirrored を使う。material3 は material-icons を推移的に持ってこないので +# 明示的に足す。版は compose BOM 任せ(集約ビルドの catalog と同じ形)。 +androidx-material-icons-core = { group = "androidx.compose.material", name = "material-icons-core" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "composeLibs" } # Test diff --git a/sample-app/build.gradle.kts b/sample-app/build.gradle.kts index bd12482..55a8249 100644 --- a/sample-app/build.gradle.kts +++ b/sample-app/build.gradle.kts @@ -57,6 +57,7 @@ dependencies { implementation(libs.androidx.ui) implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) + implementation(libs.androidx.material.icons.core) debugImplementation(platform(libs.androidx.compose.bom)) debugImplementation(libs.androidx.ui.tooling) }