mapbox / mapbox/mapbox-maps-flutter

Puck layer not added the same way on iOS and Android

オープン
#577 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Dart
スター
380
フォーク
204
PR マージ指標
30日以内にマージされた PR はありません

説明

When you set the puck settings as:

```
mapboxMap?.location.updateSettings(
LocationComponentSettings(
pulsingEnabled: false,
showAccuracyRing: true,
puckBearing: PuckBearing.COURSE,
puckBearingEnabled: true,
),
);
```

You can access the puck layer with:

```
if (Platform.isAndroid) {
puckLayerId = 'mapbox-location-indicator-layer';
} else {
puckLayerId = 'puck';
}

try {
bool? puckLayerExists =
await mapboxMap?.style.styleLayerExists(puckLayerId);
```

However when you use the same code for Android, it fails. The error tells you the puck layer does not exist.

In order to fix this you need to add `enabled: true`

```
mapboxMap?.location.updateSettings(
LocationComponentSettings(
enabled: true, // Needed for Android
pulsingEnabled: false,
showAccuracyRing: true,
puckBearing: PuckBearing.COURSE,
puckBearingEnabled: true,
),
);
```

I think this behavior should be consistent across iOS and Android. So I guess the bug is that when `enabled: true` is not provided on iOS it still adds the puck layer.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Start with LocationComponentSettings.updateSettings and the styleLayerExists call shown in the issue, then compare how the Flutter wrapper configures the location component on iOS and Android. Confirm whether omitting enabled should produce the same puck-layer behavior on both platforms; done means the behavior is consistent and the reported layer lookup no longer differs by platform.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
dart, flutter
領域
mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
40/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。