-
Notifications
You must be signed in to change notification settings - Fork 83
Update Internal LocationTracking System with New API #322
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
…ationFaceIconPainter`, `_MyLocationDefaultIconPainter`, change args more customizable
…sition position, NCameraUpdateReason reason})` with `_OnCameraChangedParams`
… tracking service
…rMapControlSender` ( `getLocationTrackingMode` method to `locationTrackingMode` getter, `setLocationTrackingMode` return type to `NLocationTrackingMode`)
…pl`, add `NaverMapController._locationTrackingModeStream`
…`NExampleMyLocationTracker`
…plier`, `NaverMapOptionApplierImpl`, `NaverMapApplierImpl`, `ApplyUtil`, `NaverMapViewOptions`
…r`, `NaverMapApplierImpl`, `ApplyUtil`, `NaverMapViewOptions`
…ingMode.none` on `NMyLocationTracker._onChangeTrackingMode`
…Map` with `uiLayer`
…Tracker` on example
…ecycle changed. and refactor code.
…ounds._fromMessageable` to internal with renaming `fromMessageable`
… `didChangeAppLifecycle`
…`NMyLocationTracker`
…` on `AppLifeCycleBinder`
…rackerOptions`, `NDefaultMyLocationTrackerPermissionStatus`
…tMyLocationTrackerPlatformImplMixin`
…nclude `NDefaultMyLocationTrackerHandler`, `NDefaultMyLocationTrackerLocationStreamHandler`, `NDefaultMyLocationTrackerHeadingStreamHandler`)
…tionTracker`, and change lifecycle too
…ngGetCurrentPositionOnceTask` on NDefaultMyLocationTracker.
…on change listener for outer scope on `NDefaultMyLocationTrackerLocationStreamHandler`
…DefaultMyLocationTrackerHeadingStreamHandler`
…non-nullable type with using `NDefaultMyLocationTracker`
…tionTracker())` as comment
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
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. |
Abstraction
이 PR에서는 내장 위치 추적 기능에 대대적인 업데이트가 포함됩니다.
*(별표) 표시된 일부 변경점을 제외하고는 기존 시스템과 완전히 호환됩니다.
NMyLocationButtonWidgetFlutter Widget 추가NMyLocationTrackerabstract 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
다음 문제들이 같이 해결됩니다.
NDefaultMyLocationTracker를 커스텀하거나(override),NMyLocationTracker를 직접 구현하여 해결 가능More Detail Info
NMyLocationButtonWidget
NMyLocationButtonWidget은 기존 네이버맵 디자인 스펙을 최대한 준수하여 순수 플러터 위젯으로 구현되었습니다. 단, 플랫폼간의 차이는 적절히 조절하여 통일하였습니다.NaverMapController.setLocationTrackingMode와 연동되어 reactive하게 UI가 변경됩니다.NMyLocationTracker
NLocationOverlay.setPosition과 카메라 업데이트 (카메라 업데이트가 필요한 모드일때)NCameraUpdateReason.location) 이외의 이유로 카메라가 이동되면,NLocationTrackingMode.noFollow로 모드 변경ValueListenable<bool> get isLoadingNDefaultMyLocationTracker
/util/location에서 구현체들을 확인할 수 있습니다.AndroidManifest.xml와Info.plist에 권한 선언은 직접 해주셔야 합니다.기타
NLocationOverlay.defaultCircleColor의 네이버맵 기본 색상은 alpha=4%이나, 시인성의 문제로 8%로 조절하였습니다.NaverMapController.setMyLocationTracker는onMapReady에서 실행하시면 편리합니다.