mapbox / mapbox/mapbox-maps-flutter
Puck layer not added the same way on iOS and Android
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Dart
- Estrellas
- 380
- Forks
- 204
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- dart, flutter
- Área
- mobile-dev
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 40/100