@rnmapbox/maps 10.1.20 → 10.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationModule.kt +3 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXCameraModule.kt +3 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXViewportModule.kt +5 -4
- package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageModule.kt +3 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt +15 -14
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt +7 -6
- package/android/src/main/java/com/rnmapbox/rnmbx/shapeAnimators/RNMBXChangeLineOffsetsShapeAnimatorModule.kt +6 -5
- package/android/src/main/java/com/rnmapbox/rnmbx/shapeAnimators/RNMBXMovePointShapeAnimatorModule.kt +3 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt +1 -0
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java +13 -13
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXCameraModuleSpec.java +1 -1
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec.java +4 -4
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java +1 -1
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXMovePointShapeAnimatorModuleSpec.java +2 -2
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java +1 -1
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java +3 -3
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXTileStoreModuleSpec.java +1 -1
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXViewportModuleSpec.java +3 -3
- package/ios/RNMBX/RNMBXFabricHelpers.h +2 -2
- package/ios/RNMBX/RNMBXMarkerViewComponentView.mm +1 -0
- package/package.json +1 -1
- /package/ios/RNMBX/ShapeAnimators/{RNMBXChangeLineOffsetsShapeAnimatorModule.m → RNMBXChangeLineOffsetsShapeAnimatorModule.mm} +0 -0
- /package/ios/RNMBX/ShapeAnimators/{RNMBXMovePointShapeAnimatorModule.m → RNMBXMovePointShapeAnimatorModule.mm} +0 -0
package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationModule.kt
CHANGED
|
@@ -5,6 +5,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
5
5
|
import com.facebook.react.bridge.ReactMethod
|
|
6
6
|
import com.facebook.react.module.annotations.ReactModule
|
|
7
7
|
import com.rnmapbox.rnmbx.NativeRNMBXPointAnnotationModuleSpec
|
|
8
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
8
9
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
9
10
|
|
|
10
11
|
@ReactModule(name = RNMBXPointAnnotationModule.NAME)
|
|
@@ -15,7 +16,7 @@ class RNMBXPointAnnotationModule(reactContext: ReactApplicationContext?, private
|
|
|
15
16
|
const val NAME = "RNMBXPointAnnotationModule"
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
private fun withPointAnnotationOnUIThread(viewRef:
|
|
19
|
+
private fun withPointAnnotationOnUIThread(viewRef: ViewRefTag?, reject: Promise, fn: (RNMBXPointAnnotation) -> Unit) {
|
|
19
20
|
if (viewRef == null) {
|
|
20
21
|
reject.reject(Exception("viewRef is null for RNMBXPointAnnotation"))
|
|
21
22
|
} else {
|
|
@@ -24,7 +25,7 @@ class RNMBXPointAnnotationModule(reactContext: ReactApplicationContext?, private
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
@ReactMethod
|
|
27
|
-
override fun refresh(viewRef:
|
|
28
|
+
override fun refresh(viewRef: ViewRefTag?, promise: Promise) {
|
|
28
29
|
withPointAnnotationOnUIThread(viewRef, promise) {
|
|
29
30
|
it.refresh()
|
|
30
31
|
promise.resolve(null)
|
|
@@ -9,12 +9,13 @@ import com.facebook.react.bridge.WritableMap
|
|
|
9
9
|
import com.facebook.react.bridge.WritableNativeMap
|
|
10
10
|
import com.rnmapbox.rnmbx.NativeRNMBXCameraModuleSpec
|
|
11
11
|
import com.rnmapbox.rnmbx.components.mapview.CommandResponse
|
|
12
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
12
13
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class RNMBXCameraModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) : NativeRNMBXCameraModuleSpec(context) {
|
|
16
17
|
private fun withViewportOnUIThread(
|
|
17
|
-
viewRef:
|
|
18
|
+
viewRef: ViewRefTag?,
|
|
18
19
|
reject: Promise,
|
|
19
20
|
fn: (RNMBXCamera) -> Unit
|
|
20
21
|
) {
|
|
@@ -42,7 +43,7 @@ class RNMBXCameraModule(context: ReactApplicationContext, val viewTagResolver: V
|
|
|
42
43
|
const val NAME = "RNMBXCameraModule"
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
override fun updateCameraStop(viewRef:
|
|
46
|
+
override fun updateCameraStop(viewRef: ViewRefTag?, stop: ReadableMap, promise: Promise) {
|
|
46
47
|
withViewportOnUIThread(viewRef, promise) {
|
|
47
48
|
it.updateCameraStop(stop)
|
|
48
49
|
promise.resolve(null)
|
|
@@ -8,11 +8,12 @@ import com.facebook.react.bridge.WritableMap
|
|
|
8
8
|
import com.facebook.react.bridge.WritableNativeMap
|
|
9
9
|
import com.rnmapbox.rnmbx.NativeRNMBXViewportModuleSpec
|
|
10
10
|
import com.rnmapbox.rnmbx.components.mapview.CommandResponse
|
|
11
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
11
12
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
12
13
|
|
|
13
14
|
class RNMBXViewportModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) : NativeRNMBXViewportModuleSpec(context) {
|
|
14
15
|
private fun withViewportOnUIThread(
|
|
15
|
-
viewRef:
|
|
16
|
+
viewRef: ViewRefTag?,
|
|
16
17
|
reject: Promise,
|
|
17
18
|
fn: (RNMBXViewport) -> Unit
|
|
18
19
|
) {
|
|
@@ -36,14 +37,14 @@ class RNMBXViewportModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
override fun getState(viewRef:
|
|
40
|
+
override fun getState(viewRef: ViewRefTag?, promise: Promise) {
|
|
40
41
|
withViewportOnUIThread(viewRef, promise) {
|
|
41
42
|
promise.resolve(it.getState())
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
override fun transitionTo(
|
|
46
|
-
viewRef:
|
|
47
|
+
viewRef: ViewRefTag?,
|
|
47
48
|
state: ReadableMap,
|
|
48
49
|
transition: ReadableMap?,
|
|
49
50
|
promise: Promise
|
|
@@ -53,7 +54,7 @@ class RNMBXViewportModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
override fun idle(viewRef:
|
|
57
|
+
override fun idle(viewRef: ViewRefTag?, promise: Promise) {
|
|
57
58
|
withViewportOnUIThread(viewRef, promise) {
|
|
58
59
|
it.idle()
|
|
59
60
|
promise.resolve(true)
|
|
@@ -5,6 +5,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
5
5
|
import com.facebook.react.bridge.ReactMethod
|
|
6
6
|
import com.facebook.react.module.annotations.ReactModule
|
|
7
7
|
import com.rnmapbox.rnmbx.NativeRNMBXImageModuleSpec
|
|
8
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
8
9
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
9
10
|
|
|
10
11
|
@ReactModule(name = RNMBXImageModule.NAME)
|
|
@@ -15,7 +16,7 @@ class RNMBXImageModule(reactContext: ReactApplicationContext?, private val viewT
|
|
|
15
16
|
const val NAME = "RNMBXImageModule"
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
private fun withImageOnUIThread(viewRef:
|
|
19
|
+
private fun withImageOnUIThread(viewRef: ViewRefTag?, reject: Promise, fn: (RNMBXImage) -> Unit) {
|
|
19
20
|
if (viewRef == null) {
|
|
20
21
|
reject.reject(Exception("viewRef is null for RNMBXImage"))
|
|
21
22
|
} else {
|
|
@@ -24,7 +25,7 @@ class RNMBXImageModule(reactContext: ReactApplicationContext?, private val viewT
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
@ReactMethod
|
|
27
|
-
override fun refresh(viewRef:
|
|
28
|
+
override fun refresh(viewRef: ViewRefTag?, promise: Promise) {
|
|
28
29
|
withImageOnUIThread(viewRef, promise) {
|
|
29
30
|
it.refresh()
|
|
30
31
|
promise.resolve(null)
|
|
@@ -8,13 +8,14 @@ import com.facebook.react.bridge.WritableNativeMap
|
|
|
8
8
|
import com.rnmapbox.rnmbx.NativeMapViewModuleSpec
|
|
9
9
|
import com.rnmapbox.rnmbx.utils.ConvertUtils
|
|
10
10
|
import com.rnmapbox.rnmbx.utils.ExpressionParser
|
|
11
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
11
12
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
12
13
|
import com.rnmapbox.rnmbx.utils.extensions.toCoordinate
|
|
13
14
|
import com.rnmapbox.rnmbx.utils.extensions.toScreenCoordinate
|
|
14
15
|
|
|
15
16
|
class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) : NativeMapViewModuleSpec(context) {
|
|
16
17
|
private fun withMapViewOnUIThread(
|
|
17
|
-
viewRef:
|
|
18
|
+
viewRef: ViewRefTag?,
|
|
18
19
|
reject: Promise,
|
|
19
20
|
fn: (RNMBXMapView) -> Unit
|
|
20
21
|
) {
|
|
@@ -38,14 +39,14 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
override fun takeSnap(viewRef:
|
|
42
|
+
override fun takeSnap(viewRef: ViewRefTag?, writeToDisk: Boolean, promise: Promise) {
|
|
42
43
|
withMapViewOnUIThread(viewRef, promise) {
|
|
43
44
|
it.takeSnap(writeToDisk, createCommandResponse(promise))
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
override fun queryTerrainElevation(
|
|
48
|
-
viewRef:
|
|
49
|
+
viewRef: ViewRefTag?,
|
|
49
50
|
coordinates: ReadableArray,
|
|
50
51
|
promise: Promise
|
|
51
52
|
) {
|
|
@@ -55,7 +56,7 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
override fun setSourceVisibility(
|
|
58
|
-
viewRef:
|
|
59
|
+
viewRef: ViewRefTag?,
|
|
59
60
|
visible: Boolean,
|
|
60
61
|
sourceId: String,
|
|
61
62
|
sourceLayerId: String?,
|
|
@@ -68,14 +69,14 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
override fun getCenter(viewRef:
|
|
72
|
+
override fun getCenter(viewRef: ViewRefTag?, promise: Promise) {
|
|
72
73
|
withMapViewOnUIThread(viewRef, promise) {
|
|
73
74
|
it.getCenter(createCommandResponse(promise))
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
override fun getCoordinateFromView(
|
|
78
|
-
viewRef:
|
|
79
|
+
viewRef: ViewRefTag?,
|
|
79
80
|
atPoint: ReadableArray,
|
|
80
81
|
promise: Promise
|
|
81
82
|
) {
|
|
@@ -84,26 +85,26 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
override fun getPointInView(viewRef:
|
|
88
|
+
override fun getPointInView(viewRef: ViewRefTag?, atCoordinate: ReadableArray, promise: Promise) {
|
|
88
89
|
withMapViewOnUIThread(viewRef, promise) {
|
|
89
90
|
it.getPointInView(atCoordinate.toCoordinate(), createCommandResponse(promise))
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
override fun getZoom(viewRef:
|
|
94
|
+
override fun getZoom(viewRef: ViewRefTag?, promise: Promise) {
|
|
94
95
|
withMapViewOnUIThread(viewRef, promise) {
|
|
95
96
|
it.getZoom(createCommandResponse(promise))
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
override fun getVisibleBounds(viewRef:
|
|
100
|
+
override fun getVisibleBounds(viewRef: ViewRefTag?, promise: Promise) {
|
|
100
101
|
withMapViewOnUIThread(viewRef, promise) {
|
|
101
102
|
it.getVisibleBounds(createCommandResponse(promise))
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
override fun queryRenderedFeaturesAtPoint(
|
|
106
|
-
viewRef:
|
|
107
|
+
viewRef: ViewRefTag?,
|
|
107
108
|
atPoint: ReadableArray,
|
|
108
109
|
withFilter: ReadableArray,
|
|
109
110
|
withLayerIDs: ReadableArray,
|
|
@@ -122,7 +123,7 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
override fun queryRenderedFeaturesInRect(
|
|
125
|
-
viewRef:
|
|
126
|
+
viewRef: ViewRefTag?,
|
|
126
127
|
withBBox: ReadableArray,
|
|
127
128
|
withFilter: ReadableArray,
|
|
128
129
|
withLayerIDs: ReadableArray?,
|
|
@@ -141,7 +142,7 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
override fun setHandledMapChangedEvents(
|
|
144
|
-
viewRef:
|
|
145
|
+
viewRef: ViewRefTag?,
|
|
145
146
|
events: ReadableArray,
|
|
146
147
|
promise: Promise
|
|
147
148
|
) {
|
|
@@ -151,14 +152,14 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver:
|
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
override fun clearData(viewRef:
|
|
155
|
+
override fun clearData(viewRef: ViewRefTag?, promise: Promise) {
|
|
155
156
|
withMapViewOnUIThread(viewRef, promise) {
|
|
156
157
|
it.clearData(createCommandResponse(promise))
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
override fun querySourceFeatures(
|
|
161
|
-
viewRef:
|
|
162
|
+
viewRef: ViewRefTag?,
|
|
162
163
|
sourceId: String,
|
|
163
164
|
withFilter: ReadableArray,
|
|
164
165
|
withSourceLayerIDs: ReadableArray,
|
package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt
CHANGED
|
@@ -9,6 +9,7 @@ import com.facebook.react.uimanager.common.UIManagerType
|
|
|
9
9
|
import com.rnmapbox.rnmbx.BuildConfig
|
|
10
10
|
import com.rnmapbox.rnmbx.NativeRNMBXShapeSourceModuleSpec
|
|
11
11
|
import com.rnmapbox.rnmbx.components.mapview.RNMBXMapView
|
|
12
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
12
13
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
13
14
|
|
|
14
15
|
@ReactModule(name = RNMBXShapeSourceModule.NAME)
|
|
@@ -16,7 +17,7 @@ class RNMBXShapeSourceModule(reactContext: ReactApplicationContext?, private val
|
|
|
16
17
|
NativeRNMBXShapeSourceModuleSpec(reactContext) {
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
private fun withShapeSourceOnUIThread(viewRef:
|
|
20
|
+
private fun withShapeSourceOnUIThread(viewRef: ViewRefTag?, reject: Promise, fn: (RNMBXShapeSource) -> Unit) {
|
|
20
21
|
if (viewRef == null) {
|
|
21
22
|
reject.reject(Exception("viewRef is null for RNMBXShapeSource"))
|
|
22
23
|
} else {
|
|
@@ -30,7 +31,7 @@ class RNMBXShapeSourceModule(reactContext: ReactApplicationContext?, private val
|
|
|
30
31
|
|
|
31
32
|
@ReactMethod
|
|
32
33
|
override fun getClusterExpansionZoom(
|
|
33
|
-
viewRef:
|
|
34
|
+
viewRef: ViewRefTag?,
|
|
34
35
|
featureJSON: String,
|
|
35
36
|
promise: Promise
|
|
36
37
|
) {
|
|
@@ -41,10 +42,10 @@ class RNMBXShapeSourceModule(reactContext: ReactApplicationContext?, private val
|
|
|
41
42
|
|
|
42
43
|
@ReactMethod
|
|
43
44
|
override fun getClusterLeaves(
|
|
44
|
-
viewRef:
|
|
45
|
+
viewRef: ViewRefTag?,
|
|
45
46
|
featureJSON: String,
|
|
46
|
-
number:
|
|
47
|
-
offset:
|
|
47
|
+
number: Int,
|
|
48
|
+
offset: Int,
|
|
48
49
|
promise: Promise
|
|
49
50
|
) {
|
|
50
51
|
withShapeSourceOnUIThread(viewRef, promise) {
|
|
@@ -53,7 +54,7 @@ class RNMBXShapeSourceModule(reactContext: ReactApplicationContext?, private val
|
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
@ReactMethod
|
|
56
|
-
override fun getClusterChildren(viewRef:
|
|
57
|
+
override fun getClusterChildren(viewRef: ViewRefTag?, featureJSON: String, promise: Promise) {
|
|
57
58
|
withShapeSourceOnUIThread(viewRef, promise) {
|
|
58
59
|
it.getClusterChildren(featureJSON, promise)
|
|
59
60
|
}
|
|
@@ -11,6 +11,7 @@ import com.mapbox.turf.TurfConstants.UNIT_METERS
|
|
|
11
11
|
import com.mapbox.turf.TurfMeasurement
|
|
12
12
|
import com.mapbox.turf.TurfMisc
|
|
13
13
|
import com.rnmapbox.rnmbx.NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec
|
|
14
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
14
15
|
|
|
15
16
|
class ChangeLineOffsetsShapeAnimator(tag: Tag, _lineString: LineString, startOffset: Double, endOffset: Double): ShapeAnimatorCommon(tag) {
|
|
16
17
|
private var lineString = _lineString
|
|
@@ -153,7 +154,7 @@ class RNMBXChangeLineOffsetsShapeAnimatorModule(
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
override fun create(
|
|
156
|
-
tag:
|
|
157
|
+
tag: ViewRefTag,
|
|
157
158
|
coordinates: ReadableArray,
|
|
158
159
|
startOffset: Double,
|
|
159
160
|
endOffset: Double,
|
|
@@ -172,11 +173,11 @@ class RNMBXChangeLineOffsetsShapeAnimatorModule(
|
|
|
172
173
|
promise?.resolve(tag.toInt())
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
private fun getAnimator(tag:
|
|
176
|
+
private fun getAnimator(tag: ViewRefTag): ChangeLineOffsetsShapeAnimator {
|
|
176
177
|
return shapeAnimatorManager.get(tag.toLong()) as ChangeLineOffsetsShapeAnimator
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
override fun setLineString(tag:
|
|
180
|
+
override fun setLineString(tag: ViewRefTag, coordinates: ReadableArray?, startOffset: Double, endOffset: Double, promise: Promise?) {
|
|
180
181
|
val animator = getAnimator(tag)
|
|
181
182
|
|
|
182
183
|
if (coordinates == null) {
|
|
@@ -191,13 +192,13 @@ class RNMBXChangeLineOffsetsShapeAnimatorModule(
|
|
|
191
192
|
promise?.resolve(true)
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
override fun setStartOffset(tag:
|
|
195
|
+
override fun setStartOffset(tag: ViewRefTag, offset: Double, duration: Double, promise: Promise?) {
|
|
195
196
|
val animator = getAnimator(tag)
|
|
196
197
|
animator.setStartOffset(offset, duration / 1000)
|
|
197
198
|
promise?.resolve(true)
|
|
198
199
|
}
|
|
199
200
|
|
|
200
|
-
override fun setEndOffset(tag:
|
|
201
|
+
override fun setEndOffset(tag: ViewRefTag, offset: Double, duration: Double, promise: Promise?) {
|
|
201
202
|
val animator = getAnimator(tag)
|
|
202
203
|
animator.setEndOffset(offset, duration / 1000)
|
|
203
204
|
promise?.resolve(true)
|
package/android/src/main/java/com/rnmapbox/rnmbx/shapeAnimators/RNMBXMovePointShapeAnimatorModule.kt
CHANGED
|
@@ -11,6 +11,7 @@ import com.mapbox.geojson.Point
|
|
|
11
11
|
import com.mapbox.turf.TurfConstants.UNIT_METERS
|
|
12
12
|
import com.mapbox.turf.TurfMeasurement
|
|
13
13
|
import com.rnmapbox.rnmbx.NativeRNMBXMovePointShapeAnimatorModuleSpec
|
|
14
|
+
import com.rnmapbox.rnmbx.utils.ViewRefTag
|
|
14
15
|
|
|
15
16
|
class MovePointShapeAnimator(tag: Tag, coordinate: Point) : ShapeAnimatorCommon(tag) {
|
|
16
17
|
private var point = AnimatableElement<Point>(
|
|
@@ -77,7 +78,7 @@ class RNMBXMovePointShapeAnimatorModule(
|
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
@ReactMethod
|
|
80
|
-
override fun create(tag:
|
|
81
|
+
override fun create(tag: ViewRefTag, startCoordinate: ReadableArray, promise: Promise) {
|
|
81
82
|
shapeAnimatorManager.add(
|
|
82
83
|
MovePointShapeAnimator(
|
|
83
84
|
tag.toLong(),
|
|
@@ -92,7 +93,7 @@ class RNMBXMovePointShapeAnimatorModule(
|
|
|
92
93
|
|
|
93
94
|
@ReactMethod
|
|
94
95
|
override fun moveTo(
|
|
95
|
-
tag:
|
|
96
|
+
tag: ViewRefTag,
|
|
96
97
|
coordinate: ReadableArray?,
|
|
97
98
|
duration: Double,
|
|
98
99
|
promise: Promise?
|
|
@@ -16,6 +16,7 @@ data class ViewTagWaiter<V>(
|
|
|
16
16
|
|
|
17
17
|
const val LOG_TAG = "ViewTagResolver"
|
|
18
18
|
|
|
19
|
+
typealias ViewRefTag = Int
|
|
19
20
|
// see https://github.com/rnmapbox/maps/pull/3074
|
|
20
21
|
open class ViewTagResolver(val context: ReactApplicationContext) {
|
|
21
22
|
private val createdViews: HashSet<Int> = hashSetOf<Int>()
|
|
@@ -37,53 +37,53 @@ public abstract class NativeMapViewModuleSpec extends ReactContextBaseJavaModule
|
|
|
37
37
|
|
|
38
38
|
@ReactMethod
|
|
39
39
|
@DoNotStrip
|
|
40
|
-
public abstract void takeSnap(@Nullable
|
|
40
|
+
public abstract void takeSnap(@Nullable Integer viewRef, boolean writeToDisk, Promise promise);
|
|
41
41
|
|
|
42
42
|
@ReactMethod
|
|
43
43
|
@DoNotStrip
|
|
44
|
-
public abstract void queryTerrainElevation(@Nullable
|
|
44
|
+
public abstract void queryTerrainElevation(@Nullable Integer viewRef, ReadableArray coordinates, Promise promise);
|
|
45
45
|
|
|
46
46
|
@ReactMethod
|
|
47
47
|
@DoNotStrip
|
|
48
|
-
public abstract void setSourceVisibility(@Nullable
|
|
48
|
+
public abstract void setSourceVisibility(@Nullable Integer viewRef, boolean visible, String sourceId, String sourceLayerId, Promise promise);
|
|
49
49
|
|
|
50
50
|
@ReactMethod
|
|
51
51
|
@DoNotStrip
|
|
52
|
-
public abstract void getCenter(@Nullable
|
|
52
|
+
public abstract void getCenter(@Nullable Integer viewRef, Promise promise);
|
|
53
53
|
|
|
54
54
|
@ReactMethod
|
|
55
55
|
@DoNotStrip
|
|
56
|
-
public abstract void getCoordinateFromView(@Nullable
|
|
56
|
+
public abstract void getCoordinateFromView(@Nullable Integer viewRef, ReadableArray atPoint, Promise promise);
|
|
57
57
|
|
|
58
58
|
@ReactMethod
|
|
59
59
|
@DoNotStrip
|
|
60
|
-
public abstract void getPointInView(@Nullable
|
|
60
|
+
public abstract void getPointInView(@Nullable Integer viewRef, ReadableArray atCoordinate, Promise promise);
|
|
61
61
|
|
|
62
62
|
@ReactMethod
|
|
63
63
|
@DoNotStrip
|
|
64
|
-
public abstract void getZoom(@Nullable
|
|
64
|
+
public abstract void getZoom(@Nullable Integer viewRef, Promise promise);
|
|
65
65
|
|
|
66
66
|
@ReactMethod
|
|
67
67
|
@DoNotStrip
|
|
68
|
-
public abstract void getVisibleBounds(@Nullable
|
|
68
|
+
public abstract void getVisibleBounds(@Nullable Integer viewRef, Promise promise);
|
|
69
69
|
|
|
70
70
|
@ReactMethod
|
|
71
71
|
@DoNotStrip
|
|
72
|
-
public abstract void queryRenderedFeaturesAtPoint(@Nullable
|
|
72
|
+
public abstract void queryRenderedFeaturesAtPoint(@Nullable Integer viewRef, ReadableArray atPoint, ReadableArray withFilter, ReadableArray withLayerIDs, Promise promise);
|
|
73
73
|
|
|
74
74
|
@ReactMethod
|
|
75
75
|
@DoNotStrip
|
|
76
|
-
public abstract void queryRenderedFeaturesInRect(@Nullable
|
|
76
|
+
public abstract void queryRenderedFeaturesInRect(@Nullable Integer viewRef, ReadableArray withBBox, ReadableArray withFilter, ReadableArray withLayerIDs, Promise promise);
|
|
77
77
|
|
|
78
78
|
@ReactMethod
|
|
79
79
|
@DoNotStrip
|
|
80
|
-
public abstract void setHandledMapChangedEvents(@Nullable
|
|
80
|
+
public abstract void setHandledMapChangedEvents(@Nullable Integer viewRef, ReadableArray events, Promise promise);
|
|
81
81
|
|
|
82
82
|
@ReactMethod
|
|
83
83
|
@DoNotStrip
|
|
84
|
-
public abstract void clearData(@Nullable
|
|
84
|
+
public abstract void clearData(@Nullable Integer viewRef, Promise promise);
|
|
85
85
|
|
|
86
86
|
@ReactMethod
|
|
87
87
|
@DoNotStrip
|
|
88
|
-
public abstract void querySourceFeatures(@Nullable
|
|
88
|
+
public abstract void querySourceFeatures(@Nullable Integer viewRef, String sourceId, ReadableArray withFilter, ReadableArray withSourceLayerIDs, Promise promise);
|
|
89
89
|
}
|
|
@@ -37,5 +37,5 @@ public abstract class NativeRNMBXCameraModuleSpec extends ReactContextBaseJavaMo
|
|
|
37
37
|
|
|
38
38
|
@ReactMethod
|
|
39
39
|
@DoNotStrip
|
|
40
|
-
public abstract void updateCameraStop(@Nullable
|
|
40
|
+
public abstract void updateCameraStop(@Nullable Integer viewRef, ReadableMap stop, Promise promise);
|
|
41
41
|
}
|
|
@@ -36,17 +36,17 @@ public abstract class NativeRNMBXChangeLineOffsetsShapeAnimatorModuleSpec extend
|
|
|
36
36
|
|
|
37
37
|
@ReactMethod
|
|
38
38
|
@DoNotStrip
|
|
39
|
-
public abstract void create(
|
|
39
|
+
public abstract void create(int tag, ReadableArray coordinates, double startOffset, double endOffset, Promise promise);
|
|
40
40
|
|
|
41
41
|
@ReactMethod
|
|
42
42
|
@DoNotStrip
|
|
43
|
-
public abstract void setLineString(
|
|
43
|
+
public abstract void setLineString(int tag, ReadableArray coordinates, double startOffset, double endOffset, Promise promise);
|
|
44
44
|
|
|
45
45
|
@ReactMethod
|
|
46
46
|
@DoNotStrip
|
|
47
|
-
public abstract void setStartOffset(
|
|
47
|
+
public abstract void setStartOffset(int tag, double offset, double duration, Promise promise);
|
|
48
48
|
|
|
49
49
|
@ReactMethod
|
|
50
50
|
@DoNotStrip
|
|
51
|
-
public abstract void setEndOffset(
|
|
51
|
+
public abstract void setEndOffset(int tag, double offset, double duration, Promise promise);
|
|
52
52
|
}
|
|
@@ -36,5 +36,5 @@ public abstract class NativeRNMBXImageModuleSpec extends ReactContextBaseJavaMod
|
|
|
36
36
|
|
|
37
37
|
@ReactMethod
|
|
38
38
|
@DoNotStrip
|
|
39
|
-
public abstract void refresh(@Nullable
|
|
39
|
+
public abstract void refresh(@Nullable Integer viewRef, Promise promise);
|
|
40
40
|
}
|
|
@@ -36,9 +36,9 @@ public abstract class NativeRNMBXMovePointShapeAnimatorModuleSpec extends ReactC
|
|
|
36
36
|
|
|
37
37
|
@ReactMethod
|
|
38
38
|
@DoNotStrip
|
|
39
|
-
public abstract void create(
|
|
39
|
+
public abstract void create(int tag, ReadableArray coordinate, Promise promise);
|
|
40
40
|
|
|
41
41
|
@ReactMethod
|
|
42
42
|
@DoNotStrip
|
|
43
|
-
public abstract void moveTo(
|
|
43
|
+
public abstract void moveTo(int tag, ReadableArray coordinate, double duration, Promise promise);
|
|
44
44
|
}
|
package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java
CHANGED
|
@@ -36,5 +36,5 @@ public abstract class NativeRNMBXPointAnnotationModuleSpec extends ReactContextB
|
|
|
36
36
|
|
|
37
37
|
@ReactMethod
|
|
38
38
|
@DoNotStrip
|
|
39
|
-
public abstract void refresh(@Nullable
|
|
39
|
+
public abstract void refresh(@Nullable Integer viewRef, Promise promise);
|
|
40
40
|
}
|
|
@@ -36,13 +36,13 @@ public abstract class NativeRNMBXShapeSourceModuleSpec extends ReactContextBaseJ
|
|
|
36
36
|
|
|
37
37
|
@ReactMethod
|
|
38
38
|
@DoNotStrip
|
|
39
|
-
public abstract void getClusterExpansionZoom(@Nullable
|
|
39
|
+
public abstract void getClusterExpansionZoom(@Nullable Integer viewRef, String featureJSON, Promise promise);
|
|
40
40
|
|
|
41
41
|
@ReactMethod
|
|
42
42
|
@DoNotStrip
|
|
43
|
-
public abstract void getClusterLeaves(@Nullable
|
|
43
|
+
public abstract void getClusterLeaves(@Nullable Integer viewRef, String featureJSON, int number, int offset, Promise promise);
|
|
44
44
|
|
|
45
45
|
@ReactMethod
|
|
46
46
|
@DoNotStrip
|
|
47
|
-
public abstract void getClusterChildren(@Nullable
|
|
47
|
+
public abstract void getClusterChildren(@Nullable Integer viewRef, String featureJSON, Promise promise);
|
|
48
48
|
}
|
|
@@ -41,5 +41,5 @@ public abstract class NativeRNMBXTileStoreModuleSpec extends ReactContextBaseJav
|
|
|
41
41
|
|
|
42
42
|
@ReactMethod
|
|
43
43
|
@DoNotStrip
|
|
44
|
-
public abstract void setOption(
|
|
44
|
+
public abstract void setOption(int tag, String key, String domain, ReadableMap value, Promise promise);
|
|
45
45
|
}
|
|
@@ -37,13 +37,13 @@ public abstract class NativeRNMBXViewportModuleSpec extends ReactContextBaseJava
|
|
|
37
37
|
|
|
38
38
|
@ReactMethod
|
|
39
39
|
@DoNotStrip
|
|
40
|
-
public abstract void getState(@Nullable
|
|
40
|
+
public abstract void getState(@Nullable Integer viewRef, Promise promise);
|
|
41
41
|
|
|
42
42
|
@ReactMethod
|
|
43
43
|
@DoNotStrip
|
|
44
|
-
public abstract void transitionTo(@Nullable
|
|
44
|
+
public abstract void transitionTo(@Nullable Integer viewRef, ReadableMap state, ReadableMap transition, Promise promise);
|
|
45
45
|
|
|
46
46
|
@ReactMethod
|
|
47
47
|
@DoNotStrip
|
|
48
|
-
public abstract void idle(@Nullable
|
|
48
|
+
public abstract void idle(@Nullable Integer viewRef, Promise promise);
|
|
49
49
|
}
|
|
@@ -67,7 +67,7 @@ static std::tuple<std::string, std::string> RNMBXStringifyEventData(NSDictionary
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
template <typename T>
|
|
70
|
-
void RNMBXSetCommonLayerPropsWithoutSourceID(T newProps, RNMBXLayer *_view)
|
|
70
|
+
void RNMBXSetCommonLayerPropsWithoutSourceID(const T& newProps, RNMBXLayer *_view)
|
|
71
71
|
{
|
|
72
72
|
id idx = RNMBXConvertFollyDynamicToId(newProps.id);
|
|
73
73
|
if (idx != nil) {
|
|
@@ -108,7 +108,7 @@ void RNMBXSetCommonLayerPropsWithoutSourceID(T newProps, RNMBXLayer *_view)
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
template <typename T>
|
|
111
|
-
void RNMBXSetCommonLayerProps(T newProps, RNMBXLayer *_view)
|
|
111
|
+
void RNMBXSetCommonLayerProps(const T& newProps, RNMBXLayer *_view)
|
|
112
112
|
{
|
|
113
113
|
RNMBXSetCommonLayerPropsWithoutSourceID(newProps, _view);
|
|
114
114
|
id sourceLayerID = RNMBXConvertFollyDynamicToId(newProps.sourceLayerID);
|
|
@@ -104,6 +104,7 @@ using namespace facebook::react;
|
|
|
104
104
|
layoutMetrics.contentInsets,
|
|
105
105
|
layoutMetrics.borderWidth,
|
|
106
106
|
layoutMetrics.displayType,
|
|
107
|
+
layoutMetrics.positionType, // RN074
|
|
107
108
|
layoutMetrics.layoutDirection,
|
|
108
109
|
layoutMetrics.wasLeftAndRightSwapped,
|
|
109
110
|
layoutMetrics.pointScaleFactor,
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|