Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не работает zIndex для UserLocationView #391

Open
Sarexer opened this issue Jan 16, 2025 · 0 comments
Open

Не работает zIndex для UserLocationView #391

Sarexer opened this issue Jan 16, 2025 · 0 comments

Comments

@Sarexer
Copy link

Sarexer commented Jan 16, 2025

Добрый день!
В версии плагина 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,),
          );
        },
      ),
    );
  }
}
Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant