From 6ffa04008b6b90ebebd73b829bd32fefdec02b45 Mon Sep 17 00:00:00 2001 From: sjpark Date: Fri, 26 Feb 2021 13:26:29 +0900 Subject: [PATCH] =?UTF-8?q?0.9.4=20iOS=20=EC=9E=91=EC=97=85=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/marker_map_page.dart | 6 +++++- example/lib/padding_test.dart | 1 + ios/Classes/src/NaverMapController.swift | 9 +++++++++ ios/naver_map_plugin.podspec | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/example/lib/marker_map_page.dart b/example/lib/marker_map_page.dart index 0937502..d93246d 100644 --- a/example/lib/marker_map_page.dart +++ b/example/lib/marker_map_page.dart @@ -33,7 +33,7 @@ class _MarkerMapPageState extends State { captionTextSize: 20.0, alpha: 0.8, icon: image, - anchor: AnchorPoint(0, 0), + anchor: AnchorPoint(0.5, 1), width: 45, height: 45, infoWindow: '인포 윈도우', @@ -173,6 +173,10 @@ class _MarkerMapPageState extends State { } void _onMarkerTap(Marker marker, Map iconSize) { + int pos = _markers.indexWhere((m) => m.markerId == marker.markerId); + setState(() { + _markers[pos].captionText = '선택됨'; + }); if (_currentMode == MODE_REMOVE) { setState(() { _markers.removeWhere((m) => m.markerId == marker.markerId); diff --git a/example/lib/padding_test.dart b/example/lib/padding_test.dart index 5c2a698..978fecf 100644 --- a/example/lib/padding_test.dart +++ b/example/lib/padding_test.dart @@ -22,6 +22,7 @@ class _PaddingTestState extends State { onMapCreated: _onMapCreated, initLocationTrackingMode: LocationTrackingMode.Follow, locationButtonEnable: true, + contentPadding: EdgeInsets.only(left: 150), ), Align( alignment: Alignment.bottomCenter, diff --git a/ios/Classes/src/NaverMapController.swift b/ios/Classes/src/NaverMapController.swift index 5fbb8b6..6deac6a 100644 --- a/ios/Classes/src/NaverMapController.swift +++ b/ios/Classes/src/NaverMapController.swift @@ -18,6 +18,7 @@ protocol NaverMapOptionSink { func setSymbolScale(_ symbolScale: CGFloat) func setSymbolPerspectiveRatio(_ symbolPerspectiveRatio: CGFloat) func setActiveLayers(_ activeLayers: Array) + func setContentPadding(_ paddingData: Array) func setRotationGestureEnable(_ rotationGestureEnable: Bool) func setScrollGestureEnable(_ scrollGestureEnable: Bool) @@ -29,6 +30,7 @@ protocol NaverMapOptionSink { class NaverMapController: NSObject, FlutterPlatformView, NaverMapOptionSink, NMFMapViewTouchDelegate, NMFMapViewCameraDelegate, NMFAuthManagerDelegate { + var mapView : NMFMapView var naverMap : NMFNaverMapView let viewId : Int64 @@ -330,6 +332,9 @@ class NaverMapController: NSObject, FlutterPlatformView, NaverMapOptionSink, NMF if let locationButtonEnable = option["locationButtonEnable"] as? Bool{ sink.setLocationButtonEnable(locationButtonEnable) } + if let paddingData = option["contentPadding"] as? Array { + sink.setContentPadding(paddingData) + } } // Naver touch Delegate method @@ -451,6 +456,10 @@ class NaverMapController: NSObject, FlutterPlatformView, NaverMapOptionSink, NMF mapView.positionMode = NMFMyPositionMode(rawValue: locationTrackingMode)! } + func setContentPadding(_ paddingData: Array) { + mapView.contentInset = UIEdgeInsets(top: paddingData[1], left: paddingData[0], bottom: paddingData[3], right: paddingData[2]) + } + func setLocationButtonEnable(_ locationButtonEnable: Bool) { naverMap.showLocationButton = locationButtonEnable } diff --git a/ios/naver_map_plugin.podspec b/ios/naver_map_plugin.podspec index 1f16242..05a00a7 100644 --- a/ios/naver_map_plugin.podspec +++ b/ios/naver_map_plugin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'naver_map_plugin' - s.version = '0.9.2' + s.version = '0.9.4' s.summary = 'flutter naver map plugin' s.description = <<-DESC flutter naver map plugin