Repository navigation
Add labelPosition to the default marker icon and pick the marker drawn under the tap - #13
Merged
Merged
Conversation
This was referenced Oct 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
既定マーカーアイコン(
ColorDefaultIcon/ImageDefaultIcon/DrawableDefaultIcon)にlabelPositionを追加しました。ラベルをピンの横・上・下に置けます。あわせて、タップしたときに「指の下に描かれているマーカー」を選ぶようにしました。react-sdk / ios-sdk と同じ規則です。labelPositionStringで、CSS のbackground-positionと同じ書き方です(例:"right center"。既定はAbstractDefaultIcon.DEFAULT_LABEL_POSITION="center center"で、従来どおりの表示)。anchorとinfoAnchorは、ラベルの配置から計算します。infoAnchorの指定値はピン本体に対する割合として扱います。drawMarkerFillは変えていません。ImageDefaultIconの画像だけ左にずれていた既存の不具合も直っています。タップ判定
AbstractMarkerController.findとStrategyMarkerController.findは、これまで「先端が一番近い 1 つ」を矩形判定していました。今はタップ位置の周り(256dp)のマーカーを候補にして選びます。追加した部品は次のとおりです。
MarkerHitPick:@InternalMapConductorApi。選び方の本体です。MarkerIconExtent:@InternalMapConductorApi。アイコンの実寸を返します。MarkerHitTest.hitsIcon: ラベルの広がりを見るようにしました。確認(develop 上)
./gradlew testDebugUnitTestは 257 件すべて成功しました(DefaultIconLabelPositionTestとMarkerHitTestPickTestを追加)。apiCheckを実行し、変化なしでした。マージ順
これがコアです。android-sdk-compose / android-for-maptiler / android-for-longdo の PR は、この PR に依存します。
この PR に依存する PR