Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

incorrect zoom when turning the camera programmatically on the map

Đang mở
#79 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@LuisThein đang làm issue này rồi.

Từ ngày 17/11/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug

Hello.
When using a map with the camera's bearing in degrees parameter "initialCameraPosition: CameraPosition(target: ..., zoom: 16.0, heading: 62.0)" set, when the widget is being drawn, the zoom changes to a lower value. The soft zoom using the created zoom-in and zoom-out buttons does not work correctly. _controller.zoomIn() changes the zoom level with +0.01, and _controller.zoomOut() changes the zoom value with -2.0. there is no other way to rotate the map (specifically the map, not the camera's bearing), but there is a need to rotate the map, since it is necessary to display a certain area of the map with a certain rotation of the map, for a more comfortable user experience. when the map is rotated by the user's gestures, then the zoom works correctly.

// apple_maps_flutter: 1.4.0

// Flutter 3.29.2 • channel stable • https://github.com/flutter/flutter.git
// Framework • revision c236373904 (8 months ago) • 2025-03-13 16:17:06 -0400
// Engine • revision 18b71d647a
// Tools • Dart 3.7.2 • DevTools 2.42.3

// example

class _MapSampleState extends State<MapSample> {
  late final AppleMapController _controller;

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        AppleMap(
          initialCameraPosition: const CameraPosition(
            target: LatLng(37.768, -25.335),
            zoom: 16.0,
            heading: 62.0,
          ),
          onMapCreated: (AppleMapController controller) {
            _controller = controller;
          },
        ),
        Positioned(
          top: (Theme.of(context).bottomAppBarTheme.height ?? 80),
          right: 16.0,
          child: IconButton.filled(
              onPressed: () =>
                  _controller.animateCamera(CameraUpdate.zoomIn()),
              icon: const Icon(Icons.add)),
        ),
        Positioned(
          top: (Theme.of(context).bottomAppBarTheme.height ?? 80) + 40,
          right: 16.0,
          child: IconButton.filled(
              onPressed: () =>
                  _controller.animateCamera(CameraUpdate.zoomOut()),
              icon: const Icon(Icons.remove)),
        ),
      ],
    );
  }
}

Expected behavior : correct zoomIn and zoomOut

Tested on Simulator iPhone 12 17.4 and iPhone 13 18.4

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on macOS 26.1 25B78 darwin-arm64, locale ru-RU)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.1.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.104.0)
[✓] Connected device (4 available)
[✓] Network resources

Ngôn ngữ chính
Dart
Star
84
Fork
120
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluttercommunity/apple_maps_flutter

Tất cả issue của fluttercommunity/apple_maps_flutter

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.