flutter_naver_map icon indicating copy to clipboard operation
flutter_naver_map copied to clipboard

[All Platform] Migrate to NaverMap SDK 3.18.1

Open note11g opened this issue 1 year ago • 6 comments

TODO

  • [x] Android Platform Version Migration (forceRefresh) 68940adc6f6a8870db8d4be89de2fa68399b279b
  • [x] iOS Platform Version Migration (pod) a0c97ddeaa53f874dd027523440d1b7c35ad9608
  • [ ] Marker Clustering Feature
    • [x] Interface Draft
    • [ ] Implementation Feature (PR: #224)
  • [x] Add NMapType.naviHybrid fc7dc3f405dc626d46b7662919de52c8cd7976b8
  • [x] apply ios nmap 3.18.1
    • [x] WebP Format Support (Android side PoC needed)
    • [x] Private Manifests Support (check isRequired)

일정상 여건이 된다면,

  • [ ] https://github.com/note11g/flutter_naver_map/issues/173 (@mrkim0425 님께서 구현 중)

note11g avatar Mar 20 '24 00:03 note11g

많은 api 추가가 예상되므로, 버전 1.3.0에서 해당 변경사항들이 제공될 계획입니다.

note11g avatar Mar 23 '24 12:03 note11g

iOS의 경우 업데이트 시, pod 오류가 발생합니다. 이 오류를 해결하기 위해, 다음 과정을 진행해주시기 바랍니다.

pod 오류 메시지
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      - Flutter
      - flutter_naver_map

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `flutter_naver_map` from `.symlinks/plugins/flutter_naver_map/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_8_a_6.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/8/a/6/NMapsMap/3.18.0/NMapsMap.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_4_2_c.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/3.16.0/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
    [!] CocoaPods could not find compatible versions for pod "NMapsMap":
      In snapshot (Podfile.lock):
        NMapsMap (= 3.17.0)

      In Podfile:
        flutter_naver_map (from `.symlinks/plugins/flutter_naver_map/ios`) was resolved to 1.3.0, which depends on
          NMapsMap (= 3.18.0)


    You have either:
     * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
     * changed the constraints of dependency `NMapsMap` inside your development pod `flutter_naver_map`.
       You should run `pod update NMapsMap` to apply changes you've made.

    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
    <internal:kernel>:90:in `tap'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in `process_topmost_state'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/resolver.rb:94:in `resolve'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer/analyzer.rb:1082:in `block in resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer/analyzer.rb:1080:in `resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer/analyzer.rb:125:in `analyze'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer.rb:422:in `analyze'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/installer.rb:162:in `install!'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/command/install.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/lib/cocoapods/command.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/gems/cocoapods-1.14.2/bin/pod:55:in `<top (required)>'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/bin/pod:25:in `load'
    /opt/homebrew/Cellar/cocoapods/1.14.2/libexec/bin/pod:25:in `<main>'

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Error running pod install
Error launching application on iPhone 15 Pro Max.

오류 해결 방법

  1. pub get (with flutter_naver_map: ^1.3.0)
  2. cd ios & pod update

note11g avatar Apr 03 '24 09:04 note11g

클러스터링 설계 초안

추후 내용 추가 예정입니다.

NaverMap(
  clusterOptions: NaverMapClusterOptions(
    enableZoomLevel: NMapRange(null, 17, includeMax: false),
    animate: true,
    margeStrategy: NClusterMergeStrategy(
      // 태그 병합이 거리 병합보다 우선됩니다.
      enableMergeByTag: true,
      mergeByEachTagEnableZoomLevel: <String, NMapRange>{
        "gu": NMapRange(11, 13, includeMax: false),
        "dong": NMapRange(13, 15),
      },
      /// 마커간의 거리가 70dp 이하인 경우 병합
      mergeByScreenDistance: 70,
      // mergeByScreenDistanceEnableZoomLevel: NMapRange(13, null, includeMin: false), // 필요한지 검토
      /// 200dp보다 멀리 떨어져있는 경우에는 병합하지 않음. 탐색 공간 제한.
      maxMergeableScreenDistance: 200,
    ),
    clusterMarkerBuilder: (info, clusterMarker) { 
      final tag = info.isMergedByTag ? info.children.first.tag : null;
      final icon = switch(info.size) {
        >= 100 => highDensityIcon,
        >= 30 => midDensityIcon,
        _ => lowDensityIcon,
      };
    
      clusterMarker
        ..setIcon(icon)
        ..setCaption(tag != null ? NOverlayCaption(text: tag) : null)
        ..setSubCaption(info.size);
    }, // build (marker.setVisible(true)) after running this function.
  ),
)
final restaurants = await RestaurantAPI.requestBy(region: "Seoul");
final markers = restaurants.map(
  (restaurant) => NClusterableMarker(
    id: restaurant.id,
    icon: restaurantIcon,
    caption: NOverlayCaption(text: restaurant.name),
    tags: <String, String>{
      "gu": restaurant.addr.gu, 
      "dong": restaurant.addr.dong,
    },
  )).toSet();

await mapController.addOverlayAll(markers);
// 만약, 줌 레벨의 변경 없이 변경된 병합 전략에 따라 클러스터링을 초기화하고 싶다면
// await mapController.refreshClustering();

note11g avatar Apr 10 '24 16:04 note11g

클러스터링 기능의 Preview 버전의 출시일을 안내드립니다. Android Only Preview: 검수 이전 버전 5/6(월), 검수 이후 버전 5/7(화) All Platform(Android+iOS) Support Preview: 5/8(수)

이후 사용자 피드백을 수렴하여 5월 3주차에 정식으로 1.3.0 버전이 출시될 예정입니다.

note11g avatar May 05 '24 18:05 note11g

#241 #242 해당 이슈는 1번, 2번 TODO의 작업이 완료되었으므로, 머지되면 바로 해결되는 이슈입니다. 다만, 이전버전과의 호환성 보장을 위해 추가적으로 legacy 대응이 필요할 것 같습니다만, 바로 진행되지는 않고 해당 이슈 해결 후 진행할 예정입니다.

감사합니다.

note11g avatar Jul 02 '24 09:07 note11g

#241 #242 해당 이슈는 1번, 2번 TODO의 작업이 완료되었으므로, 머지되면 바로 해결되는 이슈입니다. 다만, 이전버전과의 호환성 보장을 위해 추가적으로 legacy 대응이 필요할 것 같습니다만, 바로 진행되지는 않고 해당 이슈 해결 후 진행할 예정입니다.

감사합니다.

이 이슈에 할당된 작업들이 시간이 조금 더 소요될 것 같은 관계로, 마이그레이션 이슈(#241, #242)에 대해 1.2.3 버전으로 선제적으로 대응하기로 결정하였습니다.

+릴리즈 하였습니다. (PR: #244)

note11g avatar Jul 04 '24 06:07 note11g

https://pub.dev/packages/flutter_naver_map/versions/1.3.0-beta.2 beta 버전으로 출시되었습니다.

note11g avatar Sep 17 '24 17:09 note11g