Skip to content
Merged
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
25 changes: 23 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand All @@ -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 ..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.mapconductor.arcgis
import com.mapconductor.arcgis.zoom.ZoomAltitudeConverter
import com.mapconductor.core.features.GeoPoint
import com.mapconductor.core.features.GeoPointInterface
import com.mapconductor.core.map.CameraBearing
import com.mapconductor.core.map.MapCameraPosition
import com.mapconductor.core.spherical.Spherical
import com.mapconductor.core.zoom.AbstractZoomAltitudeConverter
Expand Down Expand Up @@ -56,7 +57,7 @@ internal object ArcGIS2DTiltEmulation {
val tiltAbsRad = Math.toRadians(tiltAbsDeg)
val altitude = converter.zoomLevelToAltitude(position.zoom, position.position.latitude, 0.0)
val distanceForward = altitude * cos(tiltAbsRad) * tan(tiltAbsRad) * TARGET_DISTANCE_SCALE
val target = Spherical.computeOffset(position.position, distanceForward, position.bearing)
val target = Spherical.computeOffset(position.position, distanceForward, CameraBearing.toNativeHeading(position.bearing))
return target to zoom
}

Expand All @@ -81,7 +82,7 @@ internal object ArcGIS2DTiltEmulation {
val tiltAbsRad = Math.toRadians(tiltAbsDeg)
val altitude = converter.zoomLevelToAltitude(originalZoom, center.latitude, 0.0)
val distanceBackward = altitude * cos(tiltAbsRad) * tan(tiltAbsRad) * TARGET_DISTANCE_SCALE
val originalPosition: GeoPoint = Spherical.computeOffset(center, distanceBackward, bearing + 180.0)
val originalPosition: GeoPoint = Spherical.computeOffset(center, distanceBackward, CameraBearing.toNativeHeading(bearing) + 180.0)
return originalPosition to originalZoom
}
}
Loading
Loading