yandex_mapkit
yandex_mapkit copied to clipboard
Не работает zIndex для UserLocationView
Добрый день! В версии плагина 4.1.0 не работает zIndex для пина текущего местоположения юзера UserLocationView на android и ios. Какой бы z индекс не ставил пину местоположения, он никак не хочет оказываться под остальными объектами. При этом z индекс у остальных объектов работает как и должно.
flutter: yandex_mapkit: 4.1.0 android: 'com.yandex.android:maps.mobile:4.5.1-full' ios: YandexMapsMobile (= 4.6.1-full)
flutter doctor
! Flutter version 3.24.3 on channel [user-branch] at /Users/ilasmakov/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
[✓] VS Code (version 1.96.3)
[✓] Connected device (4 available)
[✓] Network resources
Код для воспроизведения
class YandexMapUserPinZindex extends StatelessWidget {
const YandexMapUserPinZindex({super.key});
final point = const Point(latitude: 55.7007, longitude: 37.6317);
@override
Widget build(BuildContext context) {
return Scaffold(
body: YandexMap(
mapObjects: [
CircleMapObject(
zIndex: 3,
mapId: const MapObjectId('red_circle'),
fillColor: Colors.red,
circle: Circle(
center: point,
radius: 400,
),
),
CircleMapObject(
zIndex: 2,
mapId: const MapObjectId('blue_circle'),
circle: Circle(
center: point,
radius: 1000,
),
),
],
onMapCreated: (controller) async {
await controller.toggleUserLayer(
visible: true,
);
},
onUserLocationAdded: (view) async {
return view.copyWith(
pin: view.pin.copyWith(zIndex: 1, opacity: 1),
arrow: view.arrow.copyWith(zIndex: 1, opacity: 1,),
);
},
),
);
}
}