From 0a06047fb49e3f9c36972dbb48b9eb2a2e6e3dfa Mon Sep 17 00:00:00 2001 From: curtspec Date: Fri, 26 Feb 2021 12:46:50 +0900 Subject: [PATCH] 0.9.4 waiting for iOS code update --- .../lbstech/naver_map_plugin/NaverMapController.java | 11 +++++++++-- example/lib/padding_test.dart | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/map/naver/plugin/net/lbstech/naver_map_plugin/NaverMapController.java b/android/src/main/java/map/naver/plugin/net/lbstech/naver_map_plugin/NaverMapController.java index 1faa1f8..ea04654 100644 --- a/android/src/main/java/map/naver/plugin/net/lbstech/naver_map_plugin/NaverMapController.java +++ b/android/src/main/java/map/naver/plugin/net/lbstech/naver_map_plugin/NaverMapController.java @@ -64,6 +64,7 @@ public class NaverMapController implements private boolean disposed = false; private MethodChannel.Result mapReadyResult; private int locationTrackingMode; + private List paddingData; private final Float density; @@ -125,8 +126,10 @@ public void onMapReady(@NonNull NaverMap naverMap) { naverMap.addOnCameraChangeListener(listeners); naverMap.addOnCameraIdleListener(listeners); naverMap.setLocationSource(new FusedLocationSource(activity, 0xAAFF)); - setLocationTrackingMode(locationTrackingMode); + /// 초기 설정값 빈영 + setLocationTrackingMode(locationTrackingMode); + setContentPadding(paddingData); // 맵 완전히 만들어진 이후에 오버레이 추가. // - 패스 @@ -574,7 +577,11 @@ public void setLocationButtonEnable(boolean locationButtonEnable) { @Override public void setContentPadding(List paddingData) { - if (naverMap == null || paddingData.size() < 4) return; + if (paddingData == null || paddingData.size() < 4) return; + if (naverMap == null) { + this.paddingData = paddingData; + return; + } int left = Math.round(Convert.toFloat(paddingData.get(0)) * density); int top = Math.round(Convert.toFloat(paddingData.get(1)) * density); int right = Math.round(Convert.toFloat(paddingData.get(2)) * density); 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,