Skip to content

Conversation

@note11g
Copy link
Owner

@note11g note11g commented Jun 9, 2025

Abstraction

이 PR에서는 내장 위치 추적 기능에 대대적인 업데이트가 포함됩니다.
*(별표) 표시된 일부 변경점을 제외하고는 기존 시스템과 완전히 호환됩니다.

  • NMyLocationButtonWidget Flutter Widget 추가
  • NMyLocationTracker abstract class 추가 (해당 클래스 구현시 소스 및 동작 커스텀 가능)
  • NDefaultMyLocationTracker 추가 (NMyLocationTracker 구현체)
  • NaverMapController 변경점
    • NaverMapController.setMyLocationTracker(NMyLocationTracker)
    • NaverMapController.myLocationTracker 추가
    • NaverMapController.setLocationTrackingMode(NLocationTrackingMode)의 반환 타입을 Future<void>에서 void로 변경
    • Future<NLocationTrackingMode> NaverMapController.getLocationTrackingMode()NLocationTrackingMode NaverMapController.locationTrackingMode로 변경 *
  • NLocationOverlay.defaultCircleColor의 alpha를 24%에서 8%로 변경 *

Resolve Issues

다음 문제들이 같이 해결됩니다.

More Detail Info

NMyLocationButtonWidget

  • NMyLocationButtonWidget은 기존 네이버맵 디자인 스펙을 최대한 준수하여 순수 플러터 위젯으로 구현되었습니다. 단, 플랫폼간의 차이는 적절히 조절하여 통일하였습니다.
  • NaverMapController.setLocationTrackingMode와 연동되어 reactive하게 UI가 변경됩니다.

NMyLocationTracker

  • 기본적으로 구현되어 있는 기능들은 다음과 같습니다. (my_location_tracker.dart)
    • AppLifecycle 변화에 따른 위치 추적(구독) 일시중단 (stream.pause/resume를 지원하지 않더라도 중단 가능)
    • 더 이상 사용하지 않을 때 위치 추적(구독) 중단
    • NLocationTrackingMode가 변경될 경우, 변경된 mode에 맞는 UI로 변경하도록 NLocationOverlay 조작
    • stream에서 location, heading 변경 이벤트 수신시, NLocationOverlay.setPosition과 카메라 업데이트 (카메라 업데이트가 필요한 모드일때)
    • 위치(NCameraUpdateReason.location) 이외의 이유로 카메라가 이동되면, NLocationTrackingMode.noFollow로 모드 변경
    • 첫 위치 로드시 로딩 UI를 표시하기 위한 ValueListenable<bool> get isLoading
  • 해당 클래스를 커스텀하는 경우의 예제 코드는 여기에서 확인하실 수 있습니다.

NDefaultMyLocationTracker

  • NMyLocationTracker의 기본 구현체입니다.
  • Android, iOS를 구현하였습니다. 네이티브 소스의 /util/location에서 구현체들을 확인할 수 있습니다.
  • 위치와 방향각 모두 지원합니다. 모두 최고 정확도로 추적을 진행합니다.
  • 권한 요청을 지원합니다. 런타임에 위치 추적 모드가 권한이 필요한 모드로 변경되는 첫 시점에 권한 요청을 진행합니다. 단, AndroidManifest.xmlInfo.plist에 권한 선언은 직접 해주셔야 합니다.

기타

  • NLocationOverlay.defaultCircleColor의 네이버맵 기본 색상은 alpha=4%이나, 시인성의 문제로 8%로 조절하였습니다.
  • NaverMapController.setMyLocationTrackeronMapReady에서 실행하시면 편리합니다.

note11g added 30 commits June 3, 2025 00:14
…ationFaceIconPainter`, `_MyLocationDefaultIconPainter`, change args more customizable
…sition position, NCameraUpdateReason reason})` with `_OnCameraChangedParams`
…rMapControlSender` ( `getLocationTrackingMode` method to `locationTrackingMode` getter, `setLocationTrackingMode` return type to `NLocationTrackingMode`)
…pl`, add `NaverMapController._locationTrackingModeStream`
…plier`, `NaverMapOptionApplierImpl`, `NaverMapApplierImpl`, `ApplyUtil`, `NaverMapViewOptions`
…r`, `NaverMapApplierImpl`, `ApplyUtil`, `NaverMapViewOptions`
…ingMode.none` on `NMyLocationTracker._onChangeTrackingMode`
…ounds._fromMessageable` to internal with renaming `fromMessageable`
…rackerOptions`, `NDefaultMyLocationTrackerPermissionStatus`
…nclude `NDefaultMyLocationTrackerHandler`, `NDefaultMyLocationTrackerLocationStreamHandler`, `NDefaultMyLocationTrackerHeadingStreamHandler`)
note11g added 18 commits June 6, 2025 19:38
…ngGetCurrentPositionOnceTask` on NDefaultMyLocationTracker.
…on change listener for outer scope on `NDefaultMyLocationTrackerLocationStreamHandler`
…DefaultMyLocationTrackerHeadingStreamHandler`
…non-nullable type with using `NDefaultMyLocationTracker`
@note11g note11g requested a review from Copilot June 9, 2025 12:31
Copy link
Contributor

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

This pull request updates the internal location tracking system by introducing a new abstract location tracker interface along with its default implementation, plus updates to the map controller API and related platform-specific integrations. Key changes include:

  • Addition of new classes (NMyLocationTracker, NDefaultMyLocationTracker, and NMyLocationButtonWidget) to support customizable location tracking.
  • API adjustments in NaverMapController and removal of legacy location source handling.
  • Updates to both iOS and Android build configurations and dependency updates for location tracking.

Reviewed Changes

Copilot reviewed 58 out of 58 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ios/flutter_naver_map/Sources/flutter_naver_map/SwiftFlutterNaverMapPlugin.swift Added new SDK initializer and default location tracker initialization/disposal.
example/pubspec.yaml Added geolocator and lat_compass dependencies.
example/lib/util/example_location_tracker.dart Introduced sample implementation using new location tracker APIs with updated switch expressions.
example/lib/main.dart Integrated the sample location tracker in the map ready callback (commented out).
example/ios/Runner.xcodeproj/project.pbxproj Updated iOS project configuration to support new build phases.
android/src/main/kotlin/dev/note11/flutter_naver_map/... Removed obsolete NLocationSource and updated map options to remove location button enable handling.
android/src/main/kotlin/dev/note11/flutter_naver_map/FlutterNaverMapPlugin.kt Initialized and disposed defaultMyLocationTracker and sdkInitializer properly.

@note11g note11g mentioned this pull request Jun 2, 2025
11 tasks
@note11g note11g changed the title Update Internal LocationTracking System Update Internal LocationTracking System with New API Jun 9, 2025
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.

2 participants