Skip to content

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

Merged
merged 5 commits into from
May 18, 2025
Merged

Add NaverMap.onMapLoaded #315

merged 5 commits into from
May 18, 2025

Conversation

note11g
Copy link
Owner

@note11g note11g commented May 18, 2025

Abstraction

add onMapLoaded Event listener on NaverMap widget as argument callback.

Test

tested with real device:

  • Android: Galaxy S23 Ultra (Android 15, 1: 400Kbps limit speed, 2: 470Mbps full speed)
  • iOS: iPhone 16 Pro (iOS 18.4, 1: 500Kbps limit speed, 2: 700Mbps full speed)

@note11g note11g changed the base branch from main to dev/1.4.0 May 18, 2025 08:49
@note11g note11g requested a review from Copilot May 18, 2025 08:50
Copy link
Contributor

@Copilot Copilot AI left a 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;
Copy link
Preview

Copilot AI May 18, 2025

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.

@note11g note11g merged commit 635622d into dev/1.4.0 May 18, 2025
@note11g note11g deleted the feature/onMapLoaded branch May 18, 2025 08:51
@note11g note11g mentioned this pull request May 18, 2025
10 tasks
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

Successfully merging this pull request may close these issues.

1 participant