mapbox / mapbox/mapbox-maps-flutter
Puck layer not added the same way on iOS and Android
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Dart
- Star
- 380
- Fork
- 204
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- dart, flutter
- Lĩnh vực
- mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 40/100