-
Notifications
You must be signed in to change notification settings - Fork 77
Add NaverMap.onMapLoaded
#315
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
Conversation
…ndler.onMapLoaded` too.
…r`, `NaverMapViewEventDelegate`)
…rolSender`, `NaverMapView.setMapEventListeners`)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new onMapLoaded
callback to the NaverMap
widget that fires once the map’s data has fully loaded and rendered.
- Exposed
onMapLoaded
in the Dart widget and state, with documentation for its behavior. - Wired up native load events on both iOS (
NMFMapViewLoadDelegate
) and Android (addOnLoadListener
). - Updated example app to demonstrate the new callback.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
lib/src/widget/map_widget.dart | Added onMapLoaded callback and state handling |
lib/src/controller/map/handler.dart | Declared onMapLoaded() in control handler mixin |
ios/Classes/view/NaverMapViewEventDelegate.swift | Registered and implemented mapViewDidFinishLoadingMap |
ios/Classes/controller/NaverMapController.swift | Invoked channel method for onMapLoaded |
ios/Classes/controller/NaverMapControlSender.swift | Added onMapLoaded() to sender protocol |
example/lib/main.dart | Hooked up onMapLoaded in example usage |
android/src/main/kotlin/.../view/NaverMapView.kt | Renamed listeners setup, added load listener |
android/src/main/kotlin/.../controller/NaverMapController.kt | Implemented onMapLoaded in controller |
android/src/main/kotlin/.../controller/NaverMapControlSender.kt | Added onMapLoaded() to sender interface |
Comments suppressed due to low confidence (1)
lib/src/widget/map_widget.dart:44
- The new
onMapLoaded
callback is not covered by existing tests. Consider adding unit or integration tests to verify that this callback is triggered once the map finishes loading under various network conditions.
final void Function()? onMapLoaded;
/// 데이터가 모두 로드되어야 실행되므로, [onMapReady] 이후에 한번만 실행됩니다. | ||
/// | ||
/// 네트워크 속도가 느리거나, 연결에 실패한 경우에는 실행되지 않을 수 있음을 유의해주세요. | ||
final void Function()? onMapLoaded; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider having onMapLoaded
accept the NaverMapController
like onMapReady
does, so consumers can interact with the map controller immediately when loading completes, ensuring consistency in the API design.
Copilot uses AI. Check for mistakes.
Abstraction
add
onMapLoaded
Event listener onNaverMap
widget as argument callback.Test
tested with real device: