All existing annotations are re-sent and redrawn on every update (causes flicker/lag)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- mobile, performance
Hướng nghiên cứu
Đọc lib/src/annotation_updates.dart và kiểm tra cách các chú thích trước đó và hiện tại được so sánh khi tạo annotationsToChange. Xác nhận hành vi bằng cách đối chiếu với phần triển khai phép so sánh bằng nhau của chú thích, sau đó thêm hoặc cập nhật các bài kiểm thử tập trung vào chú thích không thay đổi. Hoàn thành khi chú thích không thay đổi bị loại khỏi các bản cập nhật, còn chú thích đã thay đổi vẫn được chuyển đến phía native.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Every time AppleMap.annotations changes, every annotation that is still on the map is sent to the native side as "changed", even if nothing about it changed. On iOS each of them is then rebuilt and redrawn (with a 0.32 s animation), so with a few dozen annotations the map visibly flickers and stutters on every update. This is probably the cause of #57.
Cause
lib/src/annotation_updates.dartbuildsannotationsToChangefrom the intersection of previous and current ids without comparing them:
(final Set<Annotation> _annotationsToChange = currentAnnotationIds .intersection(prevAnnotationIds) .map(idToCurrentAnnotation) .toSet();google_maps_flutterfilters these with.where(hasChanged).)- On iOS,
annotationsToChangecreates a newFlutterAnnotationfrom the dictionary (decoding the icon bytes into a newUIImage) and compares it with!=.AnnotationIcon ==comparesimageby reference, so it is always "different" andupdateAnnotationruns for every annotation.
Fix (one line, Dart side). Annotation == already ignores onTap, so unchanged annotations compare equal if the app reuses the same BitmapDescriptor instance:
final Set<Annotation> _annotationsToChange = currentAnnotationIds
.intersection(prevAnnotationIds)
.where((AnnotationId id) => previousAnnotations[id] != currentAnnotations[id])
.map(idToCurrentAnnotation)
.toSet();
With this change, in our app (≈ 50 annotations re-grouped on every zoom/pan) the flicker on a real iPhone 16 Pro is gone.
Version: apple_maps_flutter 1.4.0, iOS 27, Flutter 3.32.1.
Happy to open a PR with this change.
- 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
- Đọ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.
Issue khác của fluttercommunity/apple_maps_flutter
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
fluttercommunity/apple_maps_flutter#85 · 8 bình luận · 5 reaction ·
-
Crash in MKPuckAccuracyLayer _updateColors due to CFStringGetLength (iOS)Có thể làm lại được @LuisThein đã nhận 275 ngày trước và không có pull request nào đang mở. Đang mởbug
fluttercommunity/apple_maps_flutter#81 · 1 người được giao ·
-
incorrect zoom when turning the camera programmatically on the mapCó thể làm lại được @LuisThein đã nhận 338 ngày trước và không có pull request nào đang mở. Đang mởbug
fluttercommunity/apple_maps_flutter#79 · 1 người được giao ·
-
Apple maps consumes more CPU and memory than google mapsCó thể làm lại được @LuisThein đã nhận 441 ngày trước và không có pull request nào đang mở. Đang mởbug
fluttercommunity/apple_maps_flutter#78 · 1 người được giao ·
-
Add option to manually set light/dark appearance (overrideUserInterfaceStyle)Có thể đã có người làm @LuisThein đã nhận 500 ngày trước. Đang mởenhancement
fluttercommunity/apple_maps_flutter#77 · 2 bình luận · 1 reaction · 1 người được giao ·
Tất cả issue của fluttercommunity/apple_maps_flutter
Issue tương tự
-
type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Standalone dash flashes as its own RSVP step (e.g. Russian dialogue)Có thể đã có người làm @bezig01 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
daniel-pimenta-cc/ledor#53 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Iteration CounterĐang mởenhancement firebase
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
brysonddelozier/scribbles#24 ·