Skip to content

Keep an unset camera property from the current camera, and honour an explicit 0 - #14

Merged
wf9a5m75 merged 1 commit into
developfrom
fix/camera-unset-inherits
Oct 24, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
fix/camera-unset-inherits

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

概要

MapViewState.moveCameraTo(cameraPosition) で、カメラの zoom / bearing / tilt が未指定なら現在のカメラの値を引き継ぎ、明示的に 0 を指定したらそのまま 0 を使うようにしました。

これまでは MapCameraPosition(position = ...) で位置だけ渡しても、zoom / bearing / tilt が 0 にリセットされていました。デフォルト値が 0 なので、値を見ただけでは「0 を指定した」(zoom 0 = 世界全体)のか「何も指定していない」のかを区別できません。

変更内容

  • MapCameraPosition のコンストラクタの zoom / bearing / tilt を Double? = null にしました。指定されたかどうかは isZoomSpecified / isBearingSpecified / isTiltSpecified で持ちます。
    • プロパティの型は Double のままで、未指定なら 0 と読めます。値を読むだけのプロバイダー側は、ソースの変更が不要です。
    • JVM のシグネチャは double から java.lang.Double に変わります。API ベースラインも更新しました(MapCameraPosition の部分だけです)。
  • resolvedOnto(current) を追加しました。未指定のプロパティだけを、current の値で埋めます。プロパティごとに個別に判定します。
  • copy() は、未指定だったプロパティをコピー後も未指定のまま保ちます。
  • MapViewState.moveCameraTo(cameraPosition) は resolvedOnto(_cameraPosition) を通してからコントローラーに渡します。
  • paddings はどのドライバーもまだ対応していないので、今回は対象外です。

ios-sdk-core(MapConductor/ios-sdk-core#17)と js-sdk-core(MapConductor/js-sdk-core#7)にも同じ変更を入れています。

テスト

CameraPositionResolveTest を追加しました(位置だけ渡す・明示的な 0・プロパティごとの引き継ぎ・copy()・MapViewState 経由)。testDebugUnitTest は 263 件すべて通り、assembleRelease も成功します。

プロバイダーモジュールは、この変更に対してビルドしていません。

…explicit 0

A camera built as MapCameraPosition(position = ...) reset zoom, bearing and
tilt to 0 instead of leaving them where they were. The default is 0, so the
value alone cannot say whether the caller asked for 0 (zoom 0 is the whole
world) or said nothing.

The camera now records which of zoom / bearing / tilt the caller gave
(isZoomSpecified, ...), and MapViewState.moveCameraTo fills only the unset ones
from the current camera via resolvedOnto(). Each property is resolved on its
own, and an explicit 0 is used as given.

The properties stay Double and read 0 when unset, so the providers, which only
read them, are unchanged at the source level. The constructor now takes
Double?, which the api baseline records. copy() keeps an unset property unset.
Same change as ios-sdk-core and js-sdk-core.
@wf9a5m75
wf9a5m75 merged commit 4eb2446 into develop Oct 24, 2026
2 checks passed
@wf9a5m75
wf9a5m75 deleted the fix/camera-unset-inherits branch October 24, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant