From ab16edcb3dc3dd8add58243a512a9e8e3995104e Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Thu, 12 Nov 2026 05:04:33 -0800 Subject: [PATCH] Pass the camera's field of view to the screen projection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toScreenOffset / fromScreenOffsetSync ignored tilt, so InfoBubbles, marker animations and tile-marker hit tests drifted on a tilted map (up to 114 px from the engine's own project() at tilt 60 near the centre, 247 px at a padded centre). With the fov they match the engine within 0.4 px at tilt 0/30/60 and bearing 0/±90 on the TB520FU. Needs android-sdk-core fix/screen-projection-tilt. --- src/main/java/com/mapconductor/longdo/LongdoMapViewHolder.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/mapconductor/longdo/LongdoMapViewHolder.kt b/src/main/java/com/mapconductor/longdo/LongdoMapViewHolder.kt index 7673d5c..aed239c 100644 --- a/src/main/java/com/mapconductor/longdo/LongdoMapViewHolder.kt +++ b/src/main/java/com/mapconductor/longdo/LongdoMapViewHolder.kt @@ -19,7 +19,8 @@ import com.mapconductor.core.projection.WebMercatorScreenProjection * * ブリッジは同期の座標変換 API を持たないが、Longdo の地図は Web Mercator なので * 投影はカメラとビューの大きさだけで決まる。式はコアの [WebMercatorScreenProjection] - * にあり、ここはカメラとサイズを渡すだけ。**各所で式を書き直さないこと。** + * にあり、ここはカメラとサイズと視野角を渡すだけ。**各所で式を書き直さないこと。** + * 視野角を渡すので tilt も透視で扱う(渡さないと奥ほどずれ、tilt 60 で 250px 近くずれていた)。 */ class LongdoMapViewHolder( private val longdoMap: LongdoMap, @@ -59,6 +60,7 @@ class LongdoMapViewHolder( camera = camera, widthPx = longdoMap.width / density, heightPx = longdoMap.height / density, + fovDegrees = LONGDO_VERTICAL_FOV, ) ?: return null return Offset(offsetDp.x * density, offsetDp.y * density) } @@ -75,6 +77,7 @@ class LongdoMapViewHolder( camera = camera, widthPx = longdoMap.width / density, heightPx = longdoMap.height / density, + fovDegrees = LONGDO_VERTICAL_FOV, ) } }