@rnmapbox/maps 10.0.0-beta.74 → 10.0.0-beta.76
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/README.md +3 -3
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/camera/CameraStop.kt +61 -46
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/images/RCTMGLImagesManager.kt +5 -5
- package/ios/RCTMGL-v10/RCMTGLImage.swift +2 -1
- package/ios/RCTMGL-v10/RCTMGLImages.swift +57 -17
- package/ios/RCTMGL-v10/RCTMGLMapView.swift +11 -1
- package/ios/RCTMGL-v10/RCTMGLUtils.swift +14 -5
- package/javascript/MGLModule.ts +54 -0
- package/javascript/Mapbox.ts +97 -0
- package/javascript/classes/index.d.ts +20 -1
- package/javascript/components/Annotation.tsx +141 -0
- package/javascript/components/Callout.d.ts +35 -0
- package/javascript/components/ImageSource.tsx +81 -0
- package/javascript/components/Images.tsx +58 -6
- package/javascript/components/{MapView.js → MapView.tsx} +456 -383
- package/javascript/components/MarkerView.tsx +3 -2
- package/javascript/components/NativeBridgeComponent.tsx +1 -1
- package/javascript/components/PointAnnotation.tsx +4 -3
- package/javascript/components/RasterDemSource.tsx +105 -0
- package/javascript/components/RasterSource.tsx +124 -0
- package/javascript/components/ShapeSource.tsx +1 -1
- package/javascript/components/{Style.js → Style.tsx} +117 -35
- package/javascript/components/Terrain.tsx +8 -7
- package/javascript/components/{UserLocation.js → UserLocation.tsx} +105 -94
- package/javascript/components/VectorSource.tsx +1 -1
- package/javascript/index.ts +4 -0
- package/javascript/modules/offline/{OfflineCreatePackOptions.js → OfflineCreatePackOptions.ts} +21 -6
- package/javascript/modules/offline/{OfflinePack.js → OfflinePack.ts} +19 -4
- package/javascript/modules/offline/{offlineManager.js → offlineManager.ts} +81 -21
- package/javascript/modules/snapshot/{SnapshotOptions.js → SnapshotOptions.ts} +27 -3
- package/javascript/modules/snapshot/{snapshotManager.js → snapshotManager.ts} +2 -1
- package/javascript/types/Position.ts +1 -0
- package/javascript/utils/Logger.ts +1 -1
- package/javascript/utils/geoUtils.ts +56 -0
- package/javascript/utils/{index.js → index.ts} +41 -19
- package/lib/commonjs/MGLModule.js +37 -0
- package/lib/commonjs/MGLModule.js.map +1 -0
- package/lib/commonjs/Mapbox.js +372 -0
- package/lib/commonjs/Mapbox.js.map +1 -0
- package/lib/commonjs/classes/index.d.js +2 -0
- package/lib/commonjs/classes/index.d.js.map +1 -1
- package/lib/commonjs/components/{annotations/Annotation.js → Annotation.js} +26 -27
- package/lib/commonjs/components/Annotation.js.map +1 -0
- package/lib/commonjs/components/Callout.d.js +9 -0
- package/lib/commonjs/components/Callout.d.js.map +1 -0
- package/lib/commonjs/components/ImageSource.js +8 -25
- package/lib/commonjs/components/ImageSource.js.map +1 -1
- package/lib/commonjs/components/Images.js +17 -1
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/MapView.js +30 -289
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/MarkerView.js.map +1 -1
- package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -1
- package/lib/commonjs/components/PointAnnotation.js.map +1 -1
- package/lib/commonjs/components/RasterDemSource.js +3 -37
- package/lib/commonjs/components/RasterDemSource.js.map +1 -1
- package/lib/commonjs/components/RasterSource.js +2 -46
- package/lib/commonjs/components/RasterSource.js.map +1 -1
- package/lib/commonjs/components/Style.js +11 -15
- package/lib/commonjs/components/Style.js.map +1 -1
- package/lib/commonjs/components/Terrain.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +26 -77
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/index.js +16 -339
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -4
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
- package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
- package/lib/commonjs/modules/offline/offlineManager.js +7 -2
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
- package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -1
- package/lib/commonjs/types/Position.js +2 -0
- package/lib/commonjs/{utils/index.d.js.map → types/Position.js.map} +1 -1
- package/lib/commonjs/utils/animated/Animated.js.map +1 -1
- package/lib/commonjs/utils/geoUtils.js +12 -38
- package/lib/commonjs/utils/geoUtils.js.map +1 -1
- package/lib/commonjs/utils/index.js +3 -6
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/MGLModule.js +19 -0
- package/lib/module/MGLModule.js.map +1 -0
- package/lib/module/Mapbox.js +59 -0
- package/lib/module/Mapbox.js.map +1 -0
- package/lib/module/classes/index.d.js +2 -0
- package/lib/module/classes/index.d.js.map +1 -1
- package/lib/module/components/{annotations/Annotation.js → Annotation.js} +26 -27
- package/lib/module/components/Annotation.js.map +1 -0
- package/lib/module/components/Callout.d.js +2 -0
- package/lib/module/components/Callout.d.js.map +1 -0
- package/lib/module/components/ImageSource.js +8 -25
- package/lib/module/components/ImageSource.js.map +1 -1
- package/lib/module/components/Images.js +17 -1
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/MapView.js +31 -290
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/MarkerView.js.map +1 -1
- package/lib/module/components/NativeBridgeComponent.js.map +1 -1
- package/lib/module/components/PointAnnotation.js.map +1 -1
- package/lib/module/components/RasterDemSource.js +4 -38
- package/lib/module/components/RasterDemSource.js.map +1 -1
- package/lib/module/components/RasterSource.js +3 -47
- package/lib/module/components/RasterSource.js.map +1 -1
- package/lib/module/components/Style.js +11 -15
- package/lib/module/components/Style.js.map +1 -1
- package/lib/module/components/Terrain.js.map +1 -1
- package/lib/module/components/UserLocation.js +25 -76
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/index.js +3 -108
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/offline/OfflineCreatePackOptions.js +2 -4
- package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
- package/lib/module/modules/offline/OfflinePack.js.map +1 -1
- package/lib/module/modules/offline/offlineManager.js +1 -1
- package/lib/module/modules/offline/offlineManager.js.map +1 -1
- package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
- package/lib/module/modules/snapshot/snapshotManager.js.map +1 -1
- package/lib/module/types/Position.js +2 -0
- package/lib/module/{utils/index.d.js.map → types/Position.js.map} +1 -1
- package/lib/module/utils/animated/Animated.js.map +1 -1
- package/lib/module/utils/geoUtils.js +5 -32
- package/lib/module/utils/geoUtils.js.map +1 -1
- package/lib/module/utils/index.js +3 -5
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/MGLModule.d.ts +22 -0
- package/lib/typescript/MGLModule.d.ts.map +1 -0
- package/lib/typescript/Mapbox.d.ts +54 -0
- package/lib/typescript/Mapbox.d.ts.map +1 -0
- package/lib/typescript/components/Annotation.d.ts +34 -0
- package/lib/typescript/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/components/ImageSource.d.ts +32 -0
- package/lib/typescript/components/ImageSource.d.ts.map +1 -0
- package/lib/typescript/components/Images.d.ts +24 -2
- package/lib/typescript/components/Images.d.ts.map +1 -1
- package/lib/typescript/components/MapView.d.ts +469 -0
- package/lib/typescript/components/MapView.d.ts.map +1 -0
- package/lib/typescript/components/MarkerView.d.ts +3 -2
- package/lib/typescript/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/components/NativeBridgeComponent.d.ts +1 -1
- package/lib/typescript/components/NativeBridgeComponent.d.ts.map +1 -1
- package/lib/typescript/components/PointAnnotation.d.ts +10 -4
- package/lib/typescript/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/components/RasterDemSource.d.ts +46 -0
- package/lib/typescript/components/RasterDemSource.d.ts.map +1 -0
- package/lib/typescript/components/RasterSource.d.ts +59 -0
- package/lib/typescript/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/components/ShapeSource.d.ts +2 -2
- package/lib/typescript/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/components/Style.d.ts +74 -0
- package/lib/typescript/components/Style.d.ts.map +1 -0
- package/lib/typescript/components/Terrain.d.ts +2 -2
- package/lib/typescript/components/Terrain.d.ts.map +1 -1
- package/lib/typescript/components/UserLocation.d.ts +102 -0
- package/lib/typescript/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/components/VectorSource.d.ts +2 -2
- package/lib/typescript/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/modules/offline/OfflineCreatePackOptions.d.ts +22 -0
- package/lib/typescript/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
- package/lib/typescript/modules/offline/OfflinePack.d.ts +24 -0
- package/lib/typescript/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/modules/offline/offlineManager.d.ts +220 -0
- package/lib/typescript/modules/offline/offlineManager.d.ts.map +1 -0
- package/lib/typescript/modules/snapshot/SnapshotOptions.d.ts +41 -0
- package/lib/typescript/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
- package/lib/typescript/modules/snapshot/snapshotManager.d.ts +52 -0
- package/lib/typescript/modules/snapshot/snapshotManager.d.ts.map +1 -0
- package/lib/typescript/types/Position.d.ts +2 -0
- package/lib/typescript/types/Position.d.ts.map +1 -0
- package/lib/typescript/utils/Logger.d.ts +1 -1
- package/lib/typescript/utils/Logger.d.ts.map +1 -1
- package/lib/typescript/utils/animated/Animated.d.ts +23 -0
- package/lib/typescript/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/utils/geoUtils.d.ts +15 -0
- package/lib/typescript/utils/geoUtils.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +48 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/package.json +4 -4
- package/index.d.ts +0 -745
- package/javascript/components/ImageSource.js +0 -82
- package/javascript/components/RasterDemSource.js +0 -106
- package/javascript/components/RasterSource.js +0 -124
- package/javascript/components/annotations/Annotation.js +0 -122
- package/javascript/index.js +0 -162
- package/javascript/utils/geoUtils.d.ts +0 -10
- package/javascript/utils/geoUtils.js +0 -73
- package/javascript/utils/index.d.ts +0 -27
- package/lib/commonjs/components/annotations/Annotation.js.map +0 -1
- package/lib/commonjs/utils/geoUtils.d.js +0 -2
- package/lib/commonjs/utils/geoUtils.d.js.map +0 -1
- package/lib/commonjs/utils/index.d.js +0 -2
- package/lib/module/components/annotations/Annotation.js.map +0 -1
- package/lib/module/utils/geoUtils.d.js +0 -2
- package/lib/module/utils/geoUtils.d.js.map +0 -1
- package/lib/module/utils/index.d.js +0 -2
- /package/javascript/utils/animated/{Animated.js → Animated.ts} +0 -0
package/README.md
CHANGED
|
@@ -147,15 +147,15 @@ npm run android
|
|
|
147
147
|
```js
|
|
148
148
|
import React from 'react';
|
|
149
149
|
import { StyleSheet, View } from 'react-native';
|
|
150
|
-
import
|
|
150
|
+
import Mapbox from '@rnmapbox/maps';
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Mapbox.setAccessToken('<YOUR_ACCESSTOKEN>');
|
|
153
153
|
|
|
154
154
|
const App = () => {
|
|
155
155
|
return (
|
|
156
156
|
<View style={styles.page}>
|
|
157
157
|
<View style={styles.container}>
|
|
158
|
-
<
|
|
158
|
+
<Mapbox.MapView style={styles.map} />
|
|
159
159
|
</View>
|
|
160
160
|
</View>
|
|
161
161
|
);
|
|
@@ -2,42 +2,31 @@ package com.mapbox.rctmgl.components.camera
|
|
|
2
2
|
|
|
3
3
|
import android.animation.Animator
|
|
4
4
|
import android.content.Context
|
|
5
|
-
import com.mapbox.maps.MapView
|
|
6
|
-
import com.mapbox.maps.MapboxMap
|
|
7
5
|
import com.mapbox.rctmgl.utils.GeoJSONUtils.toPointGeometry
|
|
8
6
|
import com.mapbox.rctmgl.utils.GeoJSONUtils.toLatLng
|
|
9
7
|
import com.mapbox.rctmgl.utils.GeoJSONUtils.toLatLngBounds
|
|
10
8
|
import com.mapbox.rctmgl.utils.LatLngBounds
|
|
11
9
|
import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
|
|
12
|
-
import com.mapbox.rctmgl.components.camera.CameraUpdateItem
|
|
13
|
-
import com.mapbox.maps.CameraState
|
|
14
10
|
import com.mapbox.maps.CameraOptions
|
|
15
|
-
import com.mapbox.rctmgl.components.camera.CameraStop
|
|
16
11
|
import com.facebook.react.bridge.ReadableMap
|
|
17
|
-
import com.mapbox.rctmgl.utils.GeoJSONUtils
|
|
18
|
-
import android.util.DisplayMetrics
|
|
19
12
|
import com.mapbox.geojson.FeatureCollection
|
|
20
13
|
import com.mapbox.maps.EdgeInsets
|
|
21
14
|
import com.mapbox.rctmgl.components.camera.constants.CameraMode
|
|
22
15
|
import com.mapbox.rctmgl.utils.LatLng
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
|
26
|
-
import com.mapbox.mapboxsdk.camera.CameraUpdate;
|
|
27
|
-
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
|
|
28
|
-
import com.mapbox.mapboxsdk.geometry.LatLng;
|
|
29
|
-
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
|
|
30
|
-
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
31
|
-
*/ class CameraStop {
|
|
17
|
+
class CameraStop {
|
|
32
18
|
private var mBearing: Double? = null
|
|
33
19
|
private var mTilt: Double? = null
|
|
34
20
|
private var mZoom: Double? = null
|
|
21
|
+
|
|
35
22
|
private var mLatLng: LatLng? = null
|
|
36
23
|
private var mBounds: LatLngBounds? = null
|
|
37
|
-
|
|
38
|
-
private var
|
|
39
|
-
private var
|
|
40
|
-
private var
|
|
24
|
+
|
|
25
|
+
private var mPaddingLeft: Int? = null
|
|
26
|
+
private var mPaddingRight: Int? = null
|
|
27
|
+
private var mPaddingBottom: Int? = null
|
|
28
|
+
private var mPaddingTop: Int? = null
|
|
29
|
+
|
|
41
30
|
private var mMode = CameraMode.EASE
|
|
42
31
|
private var mDuration = 2000
|
|
43
32
|
private var mCallback: Animator.AnimatorListener? = null
|
|
@@ -65,6 +54,18 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
65
54
|
mCallback = callback
|
|
66
55
|
}
|
|
67
56
|
|
|
57
|
+
fun setPadding(
|
|
58
|
+
paddingLeft: Int?,
|
|
59
|
+
paddingRight: Int?,
|
|
60
|
+
paddingTop: Int?,
|
|
61
|
+
paddingBottom: Int?
|
|
62
|
+
) {
|
|
63
|
+
mPaddingLeft = paddingLeft
|
|
64
|
+
mPaddingRight = paddingRight
|
|
65
|
+
mPaddingTop = paddingTop
|
|
66
|
+
mPaddingBottom = paddingBottom
|
|
67
|
+
}
|
|
68
|
+
|
|
68
69
|
fun setBounds(
|
|
69
70
|
bounds: LatLngBounds?,
|
|
70
71
|
paddingLeft: Int?,
|
|
@@ -73,21 +74,18 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
73
74
|
paddingBottom: Int?
|
|
74
75
|
) {
|
|
75
76
|
mBounds = bounds
|
|
76
|
-
|
|
77
|
-
mBoundsPaddingRight = paddingRight
|
|
78
|
-
mBoundsPaddingTop = paddingTop
|
|
79
|
-
mBoundsPaddingBottom = paddingBottom
|
|
77
|
+
this.setPadding(paddingLeft, paddingRight, paddingTop, paddingBottom)
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
fun setMode(@CameraMode.Mode mode: Int) {
|
|
83
81
|
mMode = mode
|
|
84
82
|
}
|
|
85
83
|
|
|
86
|
-
fun convert(value: IntArray): EdgeInsets {
|
|
87
|
-
val left = value[0].toDouble()
|
|
88
|
-
val top = value[1].toDouble()
|
|
89
|
-
val right = value[2].toDouble()
|
|
90
|
-
val bottom = value[3].toDouble()
|
|
84
|
+
private fun convert(value: IntArray): EdgeInsets {
|
|
85
|
+
val left = value[0].toDouble()
|
|
86
|
+
val top = value[1].toDouble()
|
|
87
|
+
val right = value[2].toDouble()
|
|
88
|
+
val bottom = value[3].toDouble()
|
|
91
89
|
return EdgeInsets(
|
|
92
90
|
top, left, bottom, right
|
|
93
91
|
)
|
|
@@ -100,7 +98,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
100
98
|
builder.center(currentCamera.center)
|
|
101
99
|
builder.bearing(currentCamera.bearing)
|
|
102
100
|
|
|
103
|
-
val currentPadding = currentCamera.padding
|
|
101
|
+
val currentPadding = currentCamera.padding
|
|
104
102
|
|
|
105
103
|
builder.padding(currentCamera.padding)
|
|
106
104
|
builder.zoom(currentCamera.zoom)
|
|
@@ -110,33 +108,39 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
110
108
|
if (mTilt != null) {
|
|
111
109
|
builder.pitch(mTilt)
|
|
112
110
|
}
|
|
111
|
+
|
|
112
|
+
val paddingLeft: Int = mPaddingLeft ?: currentPadding.left.toInt()
|
|
113
|
+
val paddingTop: Int = mPaddingTop ?: currentPadding.top.toInt()
|
|
114
|
+
val paddingRight: Int = mPaddingRight ?: currentPadding.right.toInt()
|
|
115
|
+
val paddingBottom: Int = mPaddingBottom ?: currentPadding.bottom.toInt()
|
|
116
|
+
val cameraPadding = intArrayOf(paddingLeft, paddingTop, paddingRight, paddingBottom)
|
|
117
|
+
val cameraPaddingClipped = clippedPadding(cameraPadding, mapView)
|
|
118
|
+
val cameraPaddingEdgeInsets = convert(cameraPaddingClipped)
|
|
119
|
+
|
|
113
120
|
if (mLatLng != null) {
|
|
114
121
|
builder.center(mLatLng!!.point)
|
|
122
|
+
builder.padding(cameraPaddingEdgeInsets)
|
|
115
123
|
} else if (mBounds != null) {
|
|
116
124
|
val tilt = if (mTilt != null) mTilt!! else currentCamera.pitch
|
|
117
125
|
val bearing = if (mBearing != null) mBearing!! else currentCamera.bearing
|
|
118
126
|
|
|
119
|
-
val paddingLeft: Int = mBoundsPaddingLeft ?: currentPadding.left.toInt()
|
|
120
|
-
val paddingTop: Int = mBoundsPaddingTop ?: currentPadding.top.toInt()
|
|
121
|
-
val paddingRight: Int = mBoundsPaddingRight ?: currentPadding.right.toInt()
|
|
122
|
-
val paddingBottom: Int = mBoundsPaddingBottom ?: currentPadding.bottom.toInt()
|
|
123
|
-
|
|
124
|
-
val cameraPadding = intArrayOf(paddingLeft, paddingTop, paddingRight, paddingBottom)
|
|
125
|
-
val cameraPaddingClipped = clippedPadding(cameraPadding, mapView)
|
|
126
127
|
val boundsCamera = map.cameraForCoordinateBounds(
|
|
127
128
|
mBounds!!.toBounds(),
|
|
128
|
-
|
|
129
|
+
cameraPaddingEdgeInsets,
|
|
129
130
|
bearing,
|
|
130
131
|
tilt
|
|
131
132
|
)
|
|
133
|
+
|
|
132
134
|
builder.center(boundsCamera.center)
|
|
133
135
|
builder.anchor(boundsCamera.anchor)
|
|
134
136
|
builder.zoom(boundsCamera.zoom)
|
|
135
137
|
builder.padding(boundsCamera.padding)
|
|
136
138
|
}
|
|
139
|
+
|
|
137
140
|
if (mZoom != null) {
|
|
138
141
|
builder.zoom(mZoom)
|
|
139
142
|
}
|
|
143
|
+
|
|
140
144
|
return CameraUpdateItem(map, builder.build(), mDuration, mCallback, mMode)
|
|
141
145
|
}
|
|
142
146
|
|
|
@@ -148,35 +152,44 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
148
152
|
callback: Animator.AnimatorListener?
|
|
149
153
|
): CameraStop {
|
|
150
154
|
val stop = CameraStop()
|
|
155
|
+
|
|
151
156
|
if (readableMap.hasKey("pitch")) {
|
|
152
157
|
stop.setTilt(readableMap.getDouble("pitch"))
|
|
153
158
|
}
|
|
159
|
+
|
|
154
160
|
if (readableMap.hasKey("heading")) {
|
|
155
161
|
stop.setBearing(readableMap.getDouble("heading"))
|
|
156
162
|
}
|
|
163
|
+
|
|
157
164
|
if (readableMap.hasKey("centerCoordinate")) {
|
|
158
165
|
val target = toPointGeometry(readableMap.getString("centerCoordinate"))
|
|
159
166
|
stop.setLatLng(toLatLng(target!!))
|
|
160
167
|
}
|
|
168
|
+
|
|
161
169
|
if (readableMap.hasKey("zoom")) {
|
|
162
170
|
stop.setZoom(readableMap.getDouble("zoom"))
|
|
163
171
|
}
|
|
172
|
+
|
|
164
173
|
if (readableMap.hasKey("duration")) {
|
|
165
174
|
stop.setDuration(readableMap.getInt("duration"))
|
|
166
175
|
}
|
|
167
|
-
if (readableMap.hasKey("bounds")) {
|
|
168
|
-
val metrics = context.resources.displayMetrics
|
|
169
|
-
var paddingTop = getBoundsPaddingByKey(readableMap, metrics.density, "paddingTop")
|
|
170
|
-
var paddingRight = getBoundsPaddingByKey(readableMap, metrics.density, "paddingRight")
|
|
171
|
-
var paddingBottom = getBoundsPaddingByKey(readableMap, metrics.density, "paddingBottom")
|
|
172
|
-
var paddingLeft = getBoundsPaddingByKey(readableMap, metrics.density, "paddingLeft")
|
|
173
176
|
|
|
177
|
+
val metrics = context.resources.displayMetrics
|
|
178
|
+
val paddingTop = getBoundsPaddingByKey(readableMap, metrics.density, "paddingTop")
|
|
179
|
+
val paddingRight = getBoundsPaddingByKey(readableMap, metrics.density, "paddingRight")
|
|
180
|
+
val paddingBottom = getBoundsPaddingByKey(readableMap, metrics.density, "paddingBottom")
|
|
181
|
+
val paddingLeft = getBoundsPaddingByKey(readableMap, metrics.density, "paddingLeft")
|
|
182
|
+
|
|
183
|
+
if (readableMap.hasKey("bounds")) {
|
|
174
184
|
val collection = FeatureCollection.fromJson(readableMap.getString("bounds")!!)
|
|
175
185
|
stop.setBounds(
|
|
176
186
|
toLatLngBounds(collection), paddingLeft, paddingRight,
|
|
177
187
|
paddingTop, paddingBottom
|
|
178
188
|
)
|
|
189
|
+
} else {
|
|
190
|
+
stop.setPadding(paddingLeft, paddingRight, paddingTop, paddingBottom)
|
|
179
191
|
}
|
|
192
|
+
|
|
180
193
|
if (readableMap.hasKey("mode")) {
|
|
181
194
|
when (readableMap.getInt("mode")) {
|
|
182
195
|
CameraMode.FLIGHT -> stop.setMode(CameraMode.FLIGHT)
|
|
@@ -185,7 +198,9 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
185
198
|
else -> stop.setMode(CameraMode.EASE)
|
|
186
199
|
}
|
|
187
200
|
}
|
|
201
|
+
|
|
188
202
|
stop.setCallback(callback)
|
|
203
|
+
|
|
189
204
|
return stop
|
|
190
205
|
}
|
|
191
206
|
|
|
@@ -218,10 +233,10 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
|
|
218
233
|
}
|
|
219
234
|
|
|
220
235
|
private fun getBoundsPaddingByKey(map: ReadableMap, density: Float, key: String): Int? {
|
|
221
|
-
if (map.hasKey(key)) {
|
|
222
|
-
|
|
236
|
+
return if (map.hasKey(key)) {
|
|
237
|
+
(map.getInt(key) * density).toInt()
|
|
223
238
|
} else {
|
|
224
|
-
|
|
239
|
+
null
|
|
225
240
|
}
|
|
226
241
|
}
|
|
227
242
|
}
|
package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/images/RCTMGLImagesManager.kt
CHANGED
|
@@ -63,9 +63,9 @@ class RCTMGLImagesManager(private val mContext: ReactApplicationContext) :
|
|
|
63
63
|
val drawable =
|
|
64
64
|
ResourceUtils.getDrawableByName(mContext, resourceName) as BitmapDrawable
|
|
65
65
|
if (drawable != null) {
|
|
66
|
-
return NativeImage(
|
|
66
|
+
return NativeImage(resourceName, drawable)
|
|
67
67
|
} else {
|
|
68
|
-
Logger.e("RCTMGLImages", "cound not get native drawable with name: $
|
|
68
|
+
Logger.e("RCTMGLImages", "cound not get native drawable with name: $resourceName")
|
|
69
69
|
return null
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -98,10 +98,10 @@ class RCTMGLImagesManager(private val mContext: ReactApplicationContext) :
|
|
|
98
98
|
}
|
|
99
99
|
val drawable =
|
|
100
100
|
ResourceUtils.getDrawableByName(mContext, resourceName) as BitmapDrawable
|
|
101
|
-
if (drawable != null) {
|
|
102
|
-
return NativeImage(
|
|
101
|
+
if (drawable != null && resourceName != null) {
|
|
102
|
+
return NativeImage(resourceName, drawable, scale, sdf, stretchX, stretchY)
|
|
103
103
|
} else {
|
|
104
|
-
Logger.e("RCTMGLImages", "cound not get native drawable with name: $
|
|
104
|
+
Logger.e("RCTMGLImages", "cound not get native drawable with name: $resourceName")
|
|
105
105
|
return null
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -9,6 +9,7 @@ class RCTMGLImage : UIView {
|
|
|
9
9
|
var sdf: Bool? = nil
|
|
10
10
|
var stretchX: [[NSNumber]] = []
|
|
11
11
|
var stretchY: [[NSNumber]] = []
|
|
12
|
+
var content: [NSNumber]? = nil
|
|
12
13
|
|
|
13
14
|
weak var images: RCTMGLImageSetter? = nil {
|
|
14
15
|
didSet {
|
|
@@ -42,7 +43,7 @@ class RCTMGLImage : UIView {
|
|
|
42
43
|
|
|
43
44
|
func changeImage(_ image: UIImage, name: String) {
|
|
44
45
|
if let images = images {
|
|
45
|
-
let _ = images.addImage(name: name, image: image, sdf: sdf, stretchX:stretchX, stretchY:stretchY, log: "RCTMGLImage.addImage")
|
|
46
|
+
let _ = images.addImage(name: name, image: image, sdf: sdf, stretchX:stretchX, stretchY:stretchY, content:content, log: "RCTMGLImage.addImage")
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import MapboxMaps
|
|
2
2
|
|
|
3
3
|
protocol RCTMGLImageSetter : AnyObject {
|
|
4
|
-
func addImage(name: String, image: UIImage, sdf: Bool?, stretchX: [[NSNumber]], stretchY: [[NSNumber]], log: String) -> Bool
|
|
4
|
+
func addImage(name: String, image: UIImage, sdf: Bool?, stretchX: [[NSNumber]], stretchY: [[NSNumber]], content: [NSNumber]?, log: String) -> Bool
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
@@ -26,7 +26,7 @@ class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
typealias NativeImageInfo = (name:String, sdf: Bool, stretchX:[(from:Float, to:Float)], stretchY:[(from:Float, to:Float)]);
|
|
29
|
+
typealias NativeImageInfo = (name:String, sdf: Bool, stretchX:[(from:Float, to:Float)], stretchY:[(from:Float, to:Float)], content: (left:Float,top:Float,right:Float,bottom:Float)? );
|
|
30
30
|
var nativeImageInfos: [NativeImageInfo] = []
|
|
31
31
|
|
|
32
32
|
@objc open override func insertReactSubview(_ subview: UIView!, at atIndex: Int) {
|
|
@@ -80,14 +80,15 @@ class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
|
80
80
|
|
|
81
81
|
for imageName in remoteImages.keys {
|
|
82
82
|
if style.styleManager.getStyleImage(forImageId: imageName) == nil {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
logged("RCTMGLImages.addImagePlaceholder") {
|
|
84
|
+
try? style.addImage(placeholderImage, id: imageName, stretchX: [], stretchY: [])
|
|
85
|
+
missingImages[imageName] = remoteImages[imageName]
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
if missingImages.count > 0 {
|
|
89
91
|
RCTMGLUtils.fetchImages(bridge, style: style, objects: missingImages, forceUpdate: true, callback: { })
|
|
90
|
-
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
|
|
@@ -118,19 +119,51 @@ class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
func convert(stretch: [[NSNumber]]) -> [(from: Float, to: Float)] {
|
|
122
|
+
static func convert(stretch: [[NSNumber]], scale: Float = 1.0) -> [(from: Float, to: Float)] {
|
|
122
123
|
return stretch.map{ pair in
|
|
123
|
-
return (from: pair[0].floatValue, to: pair[1].floatValue)
|
|
124
|
+
return (from: pair[0].floatValue * scale, to: pair[1].floatValue * scale)
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
func convert(stretch: [(from: Float, to: Float)]) -> [ImageStretches] {
|
|
128
|
+
static func convert(stretch: [(from: Float, to: Float)]) -> [ImageStretches] {
|
|
128
129
|
return stretch.map { v in ImageStretches(first: v.from, second: v.to) }
|
|
129
130
|
}
|
|
130
131
|
|
|
132
|
+
static func convert(stretch: [[NSNumber]], scale: Float = 1.0) -> [ImageStretches] {
|
|
133
|
+
return convert(stretch: convert(stretch: stretch, scale: scale))
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static func convert(content: (left:Float, top:Float, right:Float, bottom:Float)?) -> ImageContent? {
|
|
137
|
+
guard let content = content else {
|
|
138
|
+
return nil
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return ImageContent(left:content.left, top:content.top, right:content.right, bottom:content.bottom)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static func convert(content: [NSNumber]?, scale: Float = 1.0) -> (left:Float,top:Float,right:Float,bottom:Float)? {
|
|
145
|
+
guard let content = content else {
|
|
146
|
+
return nil
|
|
147
|
+
}
|
|
148
|
+
guard content.count == 4 else {
|
|
149
|
+
Logger.log(level: .error, message: "Image content should have 4 elements got \(content)")
|
|
150
|
+
return nil
|
|
151
|
+
}
|
|
152
|
+
return (
|
|
153
|
+
left: content[0].floatValue*scale,
|
|
154
|
+
top: content[1].floatValue*scale,
|
|
155
|
+
right: content[2].floatValue*scale,
|
|
156
|
+
bottom: content[3].floatValue*scale
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
static func convert(content: [NSNumber]?, scale: Float = 1.0) -> ImageContent? {
|
|
161
|
+
return convert(content: convert(content: content, scale: scale))
|
|
162
|
+
}
|
|
163
|
+
|
|
131
164
|
func decodeImage(_ imageNameOrInfo: Any) -> NativeImageInfo? {
|
|
132
165
|
if let imageName = imageNameOrInfo as? String {
|
|
133
|
-
return (name: imageName, sdf: false, stretchX:[],stretchY:[])
|
|
166
|
+
return (name: imageName, sdf: false, stretchX:[],stretchY:[],content:nil)
|
|
134
167
|
} else if let imageInfo = imageNameOrInfo as? [String:Any] {
|
|
135
168
|
guard let name = imageInfo["name"] as? String else {
|
|
136
169
|
Logger.log(level: .warn, message: "NativeImage: \(imageInfo) has no name key")
|
|
@@ -144,14 +177,19 @@ class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
|
144
177
|
}
|
|
145
178
|
|
|
146
179
|
if let stretchXV = imageInfo["stretchX"] as? [[NSNumber]] {
|
|
147
|
-
stretchX = convert(stretch: stretchXV)
|
|
180
|
+
stretchX = RCTMGLImages.convert(stretch: stretchXV)
|
|
148
181
|
}
|
|
149
182
|
|
|
150
183
|
if let stretchYV = imageInfo["stretchY"] as? [[NSNumber]] {
|
|
151
|
-
stretchY = convert(stretch: stretchYV)
|
|
184
|
+
stretchY = RCTMGLImages.convert(stretch: stretchYV)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var content : (left:Float, top:Float, right:Float, bottom:Float)? = nil
|
|
188
|
+
if let contentV = imageInfo["content"] as? [NSNumber] {
|
|
189
|
+
content = RCTMGLImages.convert(content: contentV)
|
|
152
190
|
}
|
|
153
191
|
|
|
154
|
-
return (name: name, sdf: sdf, stretchX: stretchX, stretchY: stretchY)
|
|
192
|
+
return (name: name, sdf: sdf, stretchX: stretchX, stretchY: stretchY, content: content)
|
|
155
193
|
} else {
|
|
156
194
|
Logger.log(level: .warn, message: "RCTMGLImage.nativeImage, unexpected image: \(imageNameOrInfo)")
|
|
157
195
|
return nil
|
|
@@ -165,8 +203,9 @@ class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
|
165
203
|
if let image = UIImage(named: imageName) {
|
|
166
204
|
logged("RCTMGLImage.addNativeImage: \(imageName)") {
|
|
167
205
|
try style.addImage(image, id: imageName, sdf: imageInfo.sdf,
|
|
168
|
-
stretchX: convert(stretch: imageInfo.stretchX),
|
|
169
|
-
stretchY: convert(stretch: imageInfo.stretchY)
|
|
206
|
+
stretchX: RCTMGLImages.convert(stretch: imageInfo.stretchX),
|
|
207
|
+
stretchY: RCTMGLImages.convert(stretch: imageInfo.stretchY),
|
|
208
|
+
content: RCTMGLImages.convert(content: imageInfo.content)
|
|
170
209
|
)
|
|
171
210
|
}
|
|
172
211
|
} else {
|
|
@@ -185,15 +224,16 @@ class RCTMGLImages : UIView, RCTMGLMapComponent {
|
|
|
185
224
|
}
|
|
186
225
|
|
|
187
226
|
extension RCTMGLImages : RCTMGLImageSetter {
|
|
188
|
-
func addImage(name: String, image: UIImage, sdf: Bool?, stretchX: [[NSNumber]], stretchY: [[NSNumber]], log: String) -> Bool
|
|
227
|
+
func addImage(name: String, image: UIImage, sdf: Bool?, stretchX: [[NSNumber]], stretchY: [[NSNumber]], content: [NSNumber]?, log: String) -> Bool
|
|
189
228
|
{
|
|
190
229
|
return logged("\(log).addImage") {
|
|
191
230
|
if let style = style {
|
|
192
231
|
try style.addImage(image,
|
|
193
232
|
id:name,
|
|
194
233
|
sdf: sdf ?? false,
|
|
195
|
-
stretchX: convert(stretch:
|
|
196
|
-
stretchY: convert(stretch:
|
|
234
|
+
stretchX: RCTMGLImages.convert(stretch: stretchX),
|
|
235
|
+
stretchY: RCTMGLImages.convert(stretch: stretchY),
|
|
236
|
+
content: RCTMGLImages.convert(content: content)
|
|
197
237
|
)
|
|
198
238
|
return true
|
|
199
239
|
} else {
|
|
@@ -645,7 +645,17 @@ extension RCTMGLMapView: GestureManagerDelegate {
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
func highestZIndex(sources: [RCTMGLInteractiveElement]) -> RCTMGLInteractiveElement? {
|
|
648
|
-
|
|
648
|
+
var layersToSource : [String:RCTMGLInteractiveElement] = [:]
|
|
649
|
+
|
|
650
|
+
sources.forEach { source in
|
|
651
|
+
source.getLayerIDs().forEach { layerId in
|
|
652
|
+
if layersToSource[layerId] == nil {
|
|
653
|
+
layersToSource[layerId] = source
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
let orderedLayers = mapboxMap.style.allLayerIdentifiers
|
|
658
|
+
return orderedLayers.lazy.reversed().compactMap { layersToSource[$0.id] }.first ?? sources.first
|
|
649
659
|
}
|
|
650
660
|
|
|
651
661
|
@objc
|
|
@@ -30,9 +30,15 @@ class RCTMGLUtils {
|
|
|
30
30
|
if (forceUpdate || foundImage == nil) {
|
|
31
31
|
let image = objects[imageName]
|
|
32
32
|
if let image = image as? [String:Any] {
|
|
33
|
-
let
|
|
34
|
-
let
|
|
35
|
-
|
|
33
|
+
let scale = (image["scale"] as? NSNumber)?.floatValue ?? 1.0
|
|
34
|
+
let sdf = (image["sdf"] as? NSNumber)?.boolValue ?? false
|
|
35
|
+
let imageStretchX = image["stretchX"] as? [[NSNumber]]
|
|
36
|
+
let stretchX: [ImageStretches] = imageStretchX != nil ? RCTMGLImages.convert(stretch: imageStretchX!, scale: scale) : []
|
|
37
|
+
let imageStretchY = image["stretchY"] as? [[NSNumber]]
|
|
38
|
+
let stretchY: [ImageStretches] = imageStretchY != nil ? RCTMGLImages.convert(stretch: imageStretchY!, scale: scale) : []
|
|
39
|
+
let content: ImageContent? = RCTMGLImages.convert(content: image["content"] as? [NSNumber], scale: scale)
|
|
40
|
+
|
|
41
|
+
RCTMGLImageQueue.sharedInstance.addImage(objects[imageName], scale: Double(scale), bridge:bridge) {
|
|
36
42
|
(error,image) in
|
|
37
43
|
if image == nil {
|
|
38
44
|
RCTMGLLogWarn("Failed to fetch image: \(imageName) error:\(error)")
|
|
@@ -40,8 +46,11 @@ class RCTMGLUtils {
|
|
|
40
46
|
else {
|
|
41
47
|
DispatchQueue.main.async {
|
|
42
48
|
if let image = image {
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
logged("RCTMGLUtils.fetchImage-\(imageName)") {
|
|
50
|
+
print("width=\(image.size.width) height=\(image.size.height) scale=\(image.scale) scale2=\(scale)")
|
|
51
|
+
try style.addImage(image, id: imageName, sdf:sdf, stretchX: stretchX, stretchY: stretchY, content: content)
|
|
52
|
+
imageLoadedBlock()
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
interface MGLModule {
|
|
4
|
+
StyleURL: {
|
|
5
|
+
Street: URL;
|
|
6
|
+
Outdoors: URL;
|
|
7
|
+
Light: URL;
|
|
8
|
+
Dark: URL;
|
|
9
|
+
Satellite: URL;
|
|
10
|
+
SatelliteStreet: URL;
|
|
11
|
+
};
|
|
12
|
+
OfflinePackDownloadState: {
|
|
13
|
+
Inactive: string | number;
|
|
14
|
+
Active: string | number;
|
|
15
|
+
Complete: string | number;
|
|
16
|
+
Unknown?: string | number;
|
|
17
|
+
};
|
|
18
|
+
LineJoin: {
|
|
19
|
+
Bevel: string | number;
|
|
20
|
+
Round: string | number;
|
|
21
|
+
Miter: string | number;
|
|
22
|
+
};
|
|
23
|
+
StyleSource: {
|
|
24
|
+
DefaultSourceID: string;
|
|
25
|
+
};
|
|
26
|
+
TileServers: {
|
|
27
|
+
Mapbox: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
removeCustomHeader(headerName: string): void;
|
|
31
|
+
addCustomHeader(headerName: string, headerValue: string): void;
|
|
32
|
+
setAccessToken(accessToken: string | null): Promise<string | null>;
|
|
33
|
+
setWellKnownTileServer(tileServer: string): void;
|
|
34
|
+
getAccessToken(): Promise<string>;
|
|
35
|
+
setTelemetryEnabled(telemetryEnabled: boolean): void;
|
|
36
|
+
setConnected(connected: boolean): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const MGLModule: MGLModule = { ...NativeModules.MGLModule };
|
|
40
|
+
|
|
41
|
+
export const {
|
|
42
|
+
StyleURL,
|
|
43
|
+
OfflinePackDownloadState,
|
|
44
|
+
LineJoin,
|
|
45
|
+
StyleSource,
|
|
46
|
+
TileServers,
|
|
47
|
+
removeCustomHeader,
|
|
48
|
+
addCustomHeader,
|
|
49
|
+
setAccessToken,
|
|
50
|
+
setWellKnownTileServer,
|
|
51
|
+
getAccessToken,
|
|
52
|
+
setTelemetryEnabled,
|
|
53
|
+
setConnected,
|
|
54
|
+
} = MGLModule;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export * from './MGLModule';
|
|
2
|
+
export {
|
|
3
|
+
Camera,
|
|
4
|
+
UserTrackingMode,
|
|
5
|
+
type CameraPadding,
|
|
6
|
+
type CameraAnimationMode,
|
|
7
|
+
type CameraBounds,
|
|
8
|
+
} from './components/Camera';
|
|
9
|
+
export { Atmosphere } from './components/Atmosphere';
|
|
10
|
+
export { default as MapView, type MapState } from './components/MapView';
|
|
11
|
+
export { default as Light } from './components/Light';
|
|
12
|
+
export { default as PointAnnotation } from './components/PointAnnotation';
|
|
13
|
+
export { default as Annotation } from './components/Annotation';
|
|
14
|
+
export { default as Callout } from './components/Callout';
|
|
15
|
+
export { default as UserLocation } from './components/UserLocation';
|
|
16
|
+
export { default as VectorSource } from './components/VectorSource';
|
|
17
|
+
export { ShapeSource } from './components/ShapeSource';
|
|
18
|
+
export { default as RasterSource } from './components/RasterSource';
|
|
19
|
+
export { default as RasterDemSource } from './components/RasterDemSource';
|
|
20
|
+
export { default as ImageSource } from './components/ImageSource';
|
|
21
|
+
export { default as Images, type ImageEntry } from './components/Images';
|
|
22
|
+
export { default as Image } from './components/Image';
|
|
23
|
+
export { default as FillLayer } from './components/FillLayer';
|
|
24
|
+
export { default as FillExtrusionLayer } from './components/FillExtrusionLayer';
|
|
25
|
+
export { default as HeatmapLayer } from './components/HeatmapLayer';
|
|
26
|
+
export { default as LineLayer } from './components/LineLayer';
|
|
27
|
+
export { default as CircleLayer } from './components/CircleLayer';
|
|
28
|
+
export { default as SkyLayer } from './components/SkyLayer';
|
|
29
|
+
export { SymbolLayer } from './components/SymbolLayer';
|
|
30
|
+
export { default as RasterLayer } from './components/RasterLayer';
|
|
31
|
+
export { default as BackgroundLayer } from './components/BackgroundLayer';
|
|
32
|
+
export { Terrain } from './components/Terrain';
|
|
33
|
+
export {
|
|
34
|
+
default as locationManager,
|
|
35
|
+
type Location,
|
|
36
|
+
} from './modules/location/locationManager';
|
|
37
|
+
export {
|
|
38
|
+
default as offlineManager,
|
|
39
|
+
OfflineCreatePackOptions,
|
|
40
|
+
} from './modules/offline/offlineManager';
|
|
41
|
+
export {
|
|
42
|
+
default as snapshotManager,
|
|
43
|
+
type SnapshotOptions,
|
|
44
|
+
} from './modules/snapshot/snapshotManager';
|
|
45
|
+
export { default as MarkerView } from './components/MarkerView';
|
|
46
|
+
export { default as Animated } from './utils/animated/Animated';
|
|
47
|
+
export {
|
|
48
|
+
AnimatedCoordinatesArray,
|
|
49
|
+
AnimatedExtractCoordinateFromArray,
|
|
50
|
+
AnimatedPoint,
|
|
51
|
+
AnimatedRouteCoordinatesArray,
|
|
52
|
+
AnimatedShape,
|
|
53
|
+
} from './classes';
|
|
54
|
+
export { default as Style } from './components/Style';
|
|
55
|
+
export { default as Logger, type LogLevel } from './utils/Logger';
|
|
56
|
+
export { requestAndroidLocationPermissions } from './requestAndroidLocationPermissions';
|
|
57
|
+
export { getAnnotationsLayerID } from './utils/getAnnotationsLayerID';
|
|
58
|
+
export type {
|
|
59
|
+
FillLayerStyleProps as FillLayerStyle,
|
|
60
|
+
LineLayerStyleProps as LineLayerStyle,
|
|
61
|
+
SymbolLayerStyleProps as SymbolLayerStyle,
|
|
62
|
+
CircleLayerStyleProps as CircleLayerStyle,
|
|
63
|
+
HeatmapLayerStyleProps as HeatmapLayerStyle,
|
|
64
|
+
FillExtrusionLayerStyleProps as FillExtrusionLayerStyle,
|
|
65
|
+
RasterLayerStyleProps as RasterLayerStyle,
|
|
66
|
+
HillshadeLayerStyleProps as HillshadeLayerStyle,
|
|
67
|
+
BackgroundLayerStyleProps as BackgroundLayerStyle,
|
|
68
|
+
SkyLayerStyleProps as SkyLayerStyle,
|
|
69
|
+
LightLayerStyleProps as LightLayerStyle,
|
|
70
|
+
AtmosphereLayerStyleProps as AtmosphereLayerStyle,
|
|
71
|
+
TerrainLayerStyleProps as TerrainLayerStyle,
|
|
72
|
+
} from './utils/MapboxStyles';
|
|
73
|
+
|
|
74
|
+
import { deprecatedClass } from './utils/deprecation';
|
|
75
|
+
import { AnimatedPoint } from './classes';
|
|
76
|
+
import { UserTrackingMode } from './components/Camera';
|
|
77
|
+
|
|
78
|
+
/** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */
|
|
79
|
+
export const AnimatedMapPoint = deprecatedClass(
|
|
80
|
+
AnimatedPoint,
|
|
81
|
+
'AnimatedMapPoint is deprecated please use AnimatedPoint',
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
// types:
|
|
85
|
+
export enum StyleURL {
|
|
86
|
+
Street = 'mapbox://styles/mapbox/streets-v11',
|
|
87
|
+
Dark = 'mapbox://styles/mapbox/dark-v10',
|
|
88
|
+
Light = 'mapbox://styles/mapbox/light-v10',
|
|
89
|
+
Outdoors = 'mapbox://styles/mapbox/outdoors-v11',
|
|
90
|
+
Satellite = 'mapbox://styles/mapbox/satellite-v9',
|
|
91
|
+
SatelliteStreet = 'mapbox://styles/mapbox/satellite-streets-v11',
|
|
92
|
+
TrafficDay = 'mapbox://styles/mapbox/navigation-preview-day-v4',
|
|
93
|
+
TrafficNight = 'mapbox://styles/mapbox/navigation-preview-night-v4',
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** @deprecated UserTrackingModes is deprecated use UserTrackingMode */
|
|
97
|
+
export const UserTrackingModes = UserTrackingMode;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
import { Point } from 'geojson';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import WithAnimatedObject = Animated.WithAnimatedObject;
|
|
5
|
+
|
|
1
6
|
export class AnimatedCoordinatesArray {}
|
|
2
7
|
export class AnimatedExtractCoordinateFromArray {}
|
|
3
|
-
export class AnimatedPoint {
|
|
8
|
+
export class AnimatedPoint implements WithAnimatedObject<Point> {
|
|
9
|
+
constructor(point: Point);
|
|
10
|
+
|
|
11
|
+
timing({
|
|
12
|
+
coordinates,
|
|
13
|
+
easing,
|
|
14
|
+
duration,
|
|
15
|
+
}: {
|
|
16
|
+
coordinates: number[];
|
|
17
|
+
easing?: (x: number) => number;
|
|
18
|
+
duration?: number;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
stopAnimation();
|
|
22
|
+
}
|
|
4
23
|
export class AnimatedRouteCoordinatesArray {}
|
|
5
24
|
export class AnimatedShape {}
|