Skip to content

Commit 4993d03

Browse files
committed
Merge branch 'main' into cluster_set
2 parents 2a514c6 + cd7c7ef commit 4993d03

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

android/src/main/java/com/mjstudio/reactnativenavermap/mapview/RNCNaverMapViewWrapper.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.os.Bundle
55
import android.view.Choreographer
66
import android.view.Choreographer.FrameCallback
7+
import android.view.MotionEvent
78
import android.view.View
89
import android.widget.FrameLayout
910
import com.facebook.react.bridge.LifecycleEventListener
@@ -95,6 +96,26 @@ class RNCNaverMapViewWrapper(
9596

9697
override fun onHostDestroy() {}
9798

99+
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
100+
mapView?.withMap { map ->
101+
if (map.uiSettings.isScrollGesturesEnabled) {
102+
when (ev?.action) {
103+
MotionEvent.ACTION_DOWN,
104+
MotionEvent.ACTION_MOVE,
105+
-> {
106+
parent?.requestDisallowInterceptTouchEvent(true)
107+
}
108+
MotionEvent.ACTION_UP,
109+
MotionEvent.ACTION_CANCEL,
110+
-> {
111+
parent?.requestDisallowInterceptTouchEvent(false)
112+
}
113+
}
114+
}
115+
}
116+
return super.dispatchTouchEvent(ev)
117+
}
118+
98119
companion object {
99120
/**
100121
* A helper to get react tag id by given MapView

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mj-studio/react-native-naver-map",
3-
"version": "2.5.2",
3+
"version": "2.5.3",
44
"description": "Naver Map Component for React Native",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/spec/RNCNaverMapViewNativeComponent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ interface Props extends ViewProps {
138138
minZoom?: Double;
139139
maxZoom?: Double;
140140

141-
isShowCompass?: boolean;
142-
isShowScaleBar?: boolean;
143-
isShowZoomControls?: boolean;
141+
isShowCompass?: WithDefault<boolean, true>;
142+
isShowScaleBar?: WithDefault<boolean, true>;
143+
isShowZoomControls?: WithDefault<boolean, true>;
144144
isShowIndoorLevelPicker?: boolean;
145145
isShowLocationButton?: boolean;
146146

0 commit comments

Comments
 (0)