@rnmapbox/maps 10.0.0-beta.61 → 10.0.0-beta.64
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/install.md +1 -1
- package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +0 -55
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +11 -7
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +0 -55
- package/ios/RCTMGL/RCTMGLStyle.h +0 -5
- package/ios/RCTMGL/RCTMGLStyle.m +0 -35
- package/ios/RCTMGL-v10/RCTMGLLocationModule.swift +25 -17
- package/ios/RCTMGL-v10/RCTMGLMapView.swift +26 -23
- package/ios/RCTMGL-v10/RCTMGLMapViewManager.swift +2 -2
- package/ios/RCTMGL-v10/RCTMGLOfflineModule.swift +9 -5
- package/ios/RCTMGL-v10/RCTMGLPointAnnotation.swift +65 -43
- package/ios/RCTMGL-v10/RCTMGLPointAnnotationManager.m +1 -0
- package/ios/RCTMGL-v10/RCTMGLStyle.swift +0 -35
- package/ios/RCTMGL.xcodeproj/project.pbxproj +1 -0
- package/javascript/components/MapView.js +1 -1
- package/javascript/components/UserLocation.js +2 -2
- package/javascript/modules/location/locationManager.js +13 -1
- package/javascript/utils/MapboxStyles.d.ts +27 -31
- package/javascript/utils/styleMap.ts +0 -45
- package/javascript/web/install.md +25 -0
- package/lib/commonjs/components/MapView.js +1 -1
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +1 -1
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/modules/location/locationManager.js +8 -1
- package/lib/commonjs/modules/location/locationManager.js.map +1 -1
- package/lib/commonjs/utils/styleMap.js +1 -41
- package/lib/commonjs/utils/styleMap.js.map +1 -1
- package/lib/commonjs/web/UnimplementedComponent.js.map +1 -1
- package/lib/commonjs/web/install.md +25 -0
- package/lib/module/components/MapView.js +1 -1
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/UserLocation.js +1 -1
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/modules/location/locationManager.js +8 -1
- package/lib/module/modules/location/locationManager.js.map +1 -1
- package/lib/module/utils/styleMap.js +1 -41
- package/lib/module/utils/styleMap.js.map +1 -1
- package/lib/module/web/UnimplementedComponent.js.map +1 -1
- package/lib/module/web/install.md +25 -0
- package/lib/typescript/utils/styleMap.d.ts +0 -40
- package/lib/typescript/utils/styleMap.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native.config.js +0 -3
|
@@ -364,13 +364,17 @@ class RCTMGLOfflineModule: RCTEventEmitter {
|
|
|
364
364
|
}) { result in
|
|
365
365
|
switch result {
|
|
366
366
|
case .success(let value):
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
DispatchQueue.main.async {
|
|
368
|
+
if let progess = lastProgress {
|
|
369
|
+
self.offlinePackProgressDidChange(progress: progess, metadata: metadata, state: .complete)
|
|
370
|
+
}
|
|
371
|
+
self.tileRegionPacks[id]!.state = .complete
|
|
369
372
|
}
|
|
370
|
-
self.tileRegionPacks[id]!.state = .complete
|
|
371
373
|
case .failure(let error):
|
|
372
|
-
|
|
373
|
-
|
|
374
|
+
DispatchQueue.main.async {
|
|
375
|
+
self.tileRegionPacks[id]!.state = .inactive
|
|
376
|
+
self.offlinePackDidReceiveError(name: id, error: error)
|
|
377
|
+
}
|
|
374
378
|
}
|
|
375
379
|
}
|
|
376
380
|
|
|
@@ -13,7 +13,14 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
|
|
|
13
13
|
static let key = "RCTMGLPointAnnotation"
|
|
14
14
|
static var gid = 0;
|
|
15
15
|
|
|
16
|
-
var annotation : PointAnnotation
|
|
16
|
+
lazy var annotation : PointAnnotation = {
|
|
17
|
+
var result = PointAnnotation(coordinate: CLLocationCoordinate2D())
|
|
18
|
+
result.isDraggable = false // we implement our own drag logic
|
|
19
|
+
result.userInfo = [RCTMGLPointAnnotation.key:WeakRef(self)]
|
|
20
|
+
return result
|
|
21
|
+
}()
|
|
22
|
+
var added = false
|
|
23
|
+
|
|
17
24
|
weak var callout: RCTMGLCallout? = nil
|
|
18
25
|
var calloutId : String?
|
|
19
26
|
var image : UIImage? = nil
|
|
@@ -30,26 +37,30 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
|
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
@objc var anchor: [String:NSNumber] = [:] {
|
|
41
|
+
didSet {
|
|
42
|
+
update { annotation in
|
|
43
|
+
_updateAnchor(&annotation)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
37
46
|
}
|
|
38
|
-
|
|
39
|
-
func
|
|
40
|
-
|
|
47
|
+
|
|
48
|
+
func _updateAnchor(_ annotation: inout PointAnnotation) {
|
|
49
|
+
if !anchor.isEmpty {
|
|
50
|
+
if let image = annotation.image {
|
|
51
|
+
let size = image.image.size
|
|
52
|
+
annotation.iconAnchor = .topLeft
|
|
53
|
+
annotation.iconOffset = [size.width * (anchor["x"]?.CGFloat ?? 0.0) * -1.0, size.height * (anchor["y"]?.CGFloat ?? 0.0) * -1.0]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
41
56
|
}
|
|
42
57
|
|
|
43
58
|
func _updateCoordinate() {
|
|
44
59
|
guard let point = point() else {
|
|
45
60
|
return
|
|
46
61
|
}
|
|
47
|
-
|
|
62
|
+
update { annotation in
|
|
48
63
|
annotation.point = point
|
|
49
|
-
_refresh(annotation)
|
|
50
|
-
} else {
|
|
51
|
-
annotation = _create(point: point)
|
|
52
|
-
setAnnotationImage(inital: true)
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
66
|
|
|
@@ -79,28 +90,13 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
|
|
|
79
90
|
|
|
80
91
|
func changeImage(_ image: UIImage, initial: Bool = false) {
|
|
81
92
|
self.image = image
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
map.pointAnnotationManager.remove(oldAnnotation)
|
|
88
|
-
}
|
|
89
|
-
guard let point = oldAnnotation?.point ?? point() else {
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
-
self.annotation = _create(point: point)
|
|
93
|
-
doChangeImage(image)
|
|
93
|
+
|
|
94
|
+
update { annotation in
|
|
95
|
+
let name = "rnview-\(gid())-\(annotation.id)"
|
|
96
|
+
annotation.image = PointAnnotation.Image(image: image , name: name)
|
|
97
|
+
_updateAnchor(&annotation)
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
|
-
|
|
97
|
-
func doChangeImage(_ image: UIImage) {
|
|
98
|
-
let name = "rnview-\(gid())-\(annotation.id)"
|
|
99
|
-
annotation.image = PointAnnotation.Image(image: image , name: name)
|
|
100
|
-
if let map = self.map {
|
|
101
|
-
map.pointAnnotationManager.add(annotation)
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
100
|
|
|
105
101
|
func setAnnotationImage(inital: Bool = false) {
|
|
106
102
|
if let image = _createViewSnapshot() {
|
|
@@ -170,9 +166,7 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
|
|
|
170
166
|
if let size = image?.size {
|
|
171
167
|
calloutPtAnnotation.iconOffset = [0, -size.height]
|
|
172
168
|
}
|
|
173
|
-
self.map?.calloutAnnotationManager.annotations.append(
|
|
174
|
-
|
|
175
|
-
calloutPtAnnotation)
|
|
169
|
+
self.map?.calloutAnnotationManager.annotations.append(calloutPtAnnotation)
|
|
176
170
|
}
|
|
177
171
|
}
|
|
178
172
|
|
|
@@ -214,16 +208,12 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
|
|
|
214
208
|
|
|
215
209
|
override func addToMap(_ map: RCTMGLMapView, style: Style) {
|
|
216
210
|
self.map = map
|
|
217
|
-
|
|
218
|
-
self.map?.pointAnnotationManager.add(annotation)
|
|
219
|
-
}
|
|
211
|
+
addIfPossible()
|
|
220
212
|
}
|
|
221
213
|
|
|
222
214
|
override func removeFromMap(_ map: RCTMGLMapView) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
self.map?.pointAnnotationManager.remove(annotation)
|
|
226
|
-
}
|
|
215
|
+
removeIfAdded()
|
|
216
|
+
self.map = nil
|
|
227
217
|
}
|
|
228
218
|
|
|
229
219
|
// MARK: - RCTMGLInteractiveElement
|
|
@@ -233,3 +223,35 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
|
|
|
233
223
|
}
|
|
234
224
|
}
|
|
235
225
|
|
|
226
|
+
// MARK: - add/remove/update of point annotation
|
|
227
|
+
|
|
228
|
+
extension RCTMGLPointAnnotation {
|
|
229
|
+
func removeIfAdded() {
|
|
230
|
+
if added, let pointAnnotationManager = map?.pointAnnotationManager {
|
|
231
|
+
pointAnnotationManager.remove(annotation)
|
|
232
|
+
added = false
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@discardableResult
|
|
237
|
+
func addIfPossible() -> Bool {
|
|
238
|
+
if !added && annotation.point.coordinates.isValid(), let pointAnnotationManager = map?.pointAnnotationManager {
|
|
239
|
+
pointAnnotationManager.add(annotation)
|
|
240
|
+
added = true
|
|
241
|
+
return true
|
|
242
|
+
}
|
|
243
|
+
return false
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
func update(callback: (_ annotation: inout PointAnnotation) -> Void) {
|
|
247
|
+
callback(&annotation)
|
|
248
|
+
if let pointAnnotationManager = map?.pointAnnotationManager {
|
|
249
|
+
if added {
|
|
250
|
+
pointAnnotationManager.update(annotation)
|
|
251
|
+
} else if !added {
|
|
252
|
+
addIfPossible()
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
RCT_EXPORT_VIEW_PROPERTY(coordinate, NSString)
|
|
8
8
|
RCT_EXPORT_VIEW_PROPERTY(draggable, BOOL)
|
|
9
9
|
RCT_EXPORT_VIEW_PROPERTY(id, NSString)
|
|
10
|
+
RCT_EXPORT_VIEW_PROPERTY(anchor, NSDictionary)
|
|
10
11
|
|
|
11
12
|
RCT_REMAP_VIEW_PROPERTY(onMapboxPointAnnotationDeselected, onDeselected, RCTBubblingEventBlock)
|
|
12
13
|
RCT_REMAP_VIEW_PROPERTY(onMapboxPointAnnotationDrag, onDrag, RCTBubblingEventBlock)
|
|
@@ -74,8 +74,6 @@ func fillLayer(layer: inout FillLayer, reactStyle:Dictionary<String, Any>, apply
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
} else if (prop == "fillPatternTransition") {
|
|
78
|
-
self.setFillPatternTransition(&layer, styleValue:styleValue);
|
|
79
77
|
} else {
|
|
80
78
|
Logger.log(level:.error, message: "Unexpected property \(prop) for layer: fill")
|
|
81
79
|
}
|
|
@@ -141,8 +139,6 @@ func lineLayer(layer: inout LineLayer, reactStyle:Dictionary<String, Any>, apply
|
|
|
141
139
|
self.setLineBlurTransition(&layer, styleValue:styleValue);
|
|
142
140
|
} else if (prop == "lineDasharray") {
|
|
143
141
|
self.setLineDasharray(&layer, styleValue:styleValue);
|
|
144
|
-
} else if (prop == "lineDasharrayTransition") {
|
|
145
|
-
self.setLineDasharrayTransition(&layer, styleValue:styleValue);
|
|
146
142
|
} else if (prop == "linePattern") {
|
|
147
143
|
if (!styleValue.shouldAddImage()) {
|
|
148
144
|
self.setLinePattern(&layer, styleValue:styleValue);
|
|
@@ -166,8 +162,6 @@ func lineLayer(layer: inout LineLayer, reactStyle:Dictionary<String, Any>, apply
|
|
|
166
162
|
}
|
|
167
163
|
});
|
|
168
164
|
}
|
|
169
|
-
} else if (prop == "linePatternTransition") {
|
|
170
|
-
self.setLinePatternTransition(&layer, styleValue:styleValue);
|
|
171
165
|
} else if (prop == "lineGradient") {
|
|
172
166
|
self.setLineGradient(&layer, styleValue:styleValue);
|
|
173
167
|
} else if (prop == "lineTrimOffset") {
|
|
@@ -512,8 +506,6 @@ func fillExtrusionLayer(layer: inout FillExtrusionLayer, reactStyle:Dictionary<S
|
|
|
512
506
|
}
|
|
513
507
|
});
|
|
514
508
|
}
|
|
515
|
-
} else if (prop == "fillExtrusionPatternTransition") {
|
|
516
|
-
self.setFillExtrusionPatternTransition(&layer, styleValue:styleValue);
|
|
517
509
|
} else if (prop == "fillExtrusionHeight") {
|
|
518
510
|
self.setFillExtrusionHeight(&layer, styleValue:styleValue);
|
|
519
511
|
} else if (prop == "fillExtrusionHeightTransition") {
|
|
@@ -668,8 +660,6 @@ func backgroundLayer(layer: inout BackgroundLayer, reactStyle:Dictionary<String,
|
|
|
668
660
|
}
|
|
669
661
|
});
|
|
670
662
|
}
|
|
671
|
-
} else if (prop == "backgroundPatternTransition") {
|
|
672
|
-
self.setBackgroundPatternTransition(&layer, styleValue:styleValue);
|
|
673
663
|
} else if (prop == "backgroundOpacity") {
|
|
674
664
|
self.setBackgroundOpacity(&layer, styleValue:styleValue);
|
|
675
665
|
} else if (prop == "backgroundOpacityTransition") {
|
|
@@ -926,11 +916,6 @@ func setFillPattern(_ layer: inout FillLayer, styleValue: RCTMGLStyleValue)
|
|
|
926
916
|
|
|
927
917
|
}
|
|
928
918
|
|
|
929
|
-
func setFillPatternTransition(_ layer: inout FillLayer, styleValue: RCTMGLStyleValue)
|
|
930
|
-
{
|
|
931
|
-
layer.fillPatternTransition = styleValue.getTransition();
|
|
932
|
-
}
|
|
933
|
-
|
|
934
919
|
|
|
935
920
|
|
|
936
921
|
func setLineCap(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
@@ -1099,11 +1084,6 @@ func setLineDasharray(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
|
1099
1084
|
|
|
1100
1085
|
}
|
|
1101
1086
|
|
|
1102
|
-
func setLineDasharrayTransition(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
1103
|
-
{
|
|
1104
|
-
layer.lineDasharrayTransition = styleValue.getTransition();
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
1087
|
func setLinePattern(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
1108
1088
|
{
|
|
1109
1089
|
|
|
@@ -1113,11 +1093,6 @@ func setLinePattern(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
|
1113
1093
|
|
|
1114
1094
|
}
|
|
1115
1095
|
|
|
1116
|
-
func setLinePatternTransition(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
1117
|
-
{
|
|
1118
|
-
layer.linePatternTransition = styleValue.getTransition();
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
1096
|
func setLineGradient(_ layer: inout LineLayer, styleValue: RCTMGLStyleValue)
|
|
1122
1097
|
{
|
|
1123
1098
|
|
|
@@ -1987,11 +1962,6 @@ func setFillExtrusionPattern(_ layer: inout FillExtrusionLayer, styleValue: RCTM
|
|
|
1987
1962
|
|
|
1988
1963
|
}
|
|
1989
1964
|
|
|
1990
|
-
func setFillExtrusionPatternTransition(_ layer: inout FillExtrusionLayer, styleValue: RCTMGLStyleValue)
|
|
1991
|
-
{
|
|
1992
|
-
layer.fillExtrusionPatternTransition = styleValue.getTransition();
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
1965
|
func setFillExtrusionHeight(_ layer: inout FillExtrusionLayer, styleValue: RCTMGLStyleValue)
|
|
1996
1966
|
{
|
|
1997
1967
|
|
|
@@ -2249,11 +2219,6 @@ func setBackgroundPattern(_ layer: inout BackgroundLayer, styleValue: RCTMGLStyl
|
|
|
2249
2219
|
|
|
2250
2220
|
}
|
|
2251
2221
|
|
|
2252
|
-
func setBackgroundPatternTransition(_ layer: inout BackgroundLayer, styleValue: RCTMGLStyleValue)
|
|
2253
|
-
{
|
|
2254
|
-
layer.backgroundPatternTransition = styleValue.getTransition();
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
2222
|
func setBackgroundOpacity(_ layer: inout BackgroundLayer, styleValue: RCTMGLStyleValue)
|
|
2258
2223
|
{
|
|
2259
2224
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
https://github.com/rnmapbox/maps/issues/2254
|
|
@@ -523,7 +523,7 @@ class MapView extends NativeBridgeComponent(
|
|
|
523
523
|
* @param {Array=} layerIDs - A array of layer id's to filter the features by
|
|
524
524
|
* @return {FeatureCollection}
|
|
525
525
|
*/
|
|
526
|
-
async queryRenderedFeaturesInRect(bbox, filter = [], layerIDs =
|
|
526
|
+
async queryRenderedFeaturesInRect(bbox, filter = [], layerIDs = null) {
|
|
527
527
|
if (
|
|
528
528
|
bbox != null &&
|
|
529
529
|
(bbox.length === 4 || (MapboxGL.MapboxV10 && bbox.length === 0))
|
|
@@ -142,6 +142,8 @@ class UserLocation extends React.Component {
|
|
|
142
142
|
async componentDidMount() {
|
|
143
143
|
this._isMounted = true;
|
|
144
144
|
|
|
145
|
+
locationManager.setMinDisplacement(this.props.minDisplacement);
|
|
146
|
+
|
|
145
147
|
await this.setLocationManager({
|
|
146
148
|
running: this.needsLocationManagerRunning(),
|
|
147
149
|
});
|
|
@@ -149,8 +151,6 @@ class UserLocation extends React.Component {
|
|
|
149
151
|
if (this.renderMode === UserLocation.RenderMode.Native) {
|
|
150
152
|
return;
|
|
151
153
|
}
|
|
152
|
-
|
|
153
|
-
locationManager.setMinDisplacement(this.props.minDisplacement);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
async componentDidUpdate(prevProps) {
|
|
@@ -64,7 +64,18 @@ class LocationManager {
|
|
|
64
64
|
this.stop();
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
start(displacement =
|
|
67
|
+
start(displacement = -1) {
|
|
68
|
+
if (
|
|
69
|
+
displacement === -1 ||
|
|
70
|
+
displacement === null ||
|
|
71
|
+
displacement === undefined
|
|
72
|
+
) {
|
|
73
|
+
displacement = this._minDisplacement;
|
|
74
|
+
}
|
|
75
|
+
if (displacement == null) {
|
|
76
|
+
displacement = -1;
|
|
77
|
+
}
|
|
78
|
+
|
|
68
79
|
if (!this._isListening) {
|
|
69
80
|
MapboxGLLocationManager.start(displacement);
|
|
70
81
|
|
|
@@ -88,6 +99,7 @@ class LocationManager {
|
|
|
88
99
|
}
|
|
89
100
|
|
|
90
101
|
setMinDisplacement(minDisplacement) {
|
|
102
|
+
this._minDisplacement = minDisplacement;
|
|
91
103
|
MapboxGLLocationManager.setMinDisplacement(minDisplacement);
|
|
92
104
|
}
|
|
93
105
|
|
|
@@ -484,16 +484,14 @@ export interface FillLayerStyleProps {
|
|
|
484
484
|
*
|
|
485
485
|
* @requires fillTranslate
|
|
486
486
|
*/
|
|
487
|
-
fillTranslateAnchor?: Value<
|
|
487
|
+
fillTranslateAnchor?: Value<
|
|
488
|
+
Enum<FillTranslateAnchorEnum, FillTranslateAnchorEnumValues>,
|
|
489
|
+
['zoom']
|
|
490
|
+
>;
|
|
488
491
|
/**
|
|
489
492
|
* Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
|
|
490
493
|
*/
|
|
491
494
|
fillPattern?: Value<ResolvedImageType, ['zoom', 'feature']>;
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* The transition affecting any changes to this layer’s fillPattern property.
|
|
495
|
-
*/
|
|
496
|
-
fillPatternTransition?: Transition;
|
|
497
495
|
}
|
|
498
496
|
export interface LineLayerStyleProps {
|
|
499
497
|
/**
|
|
@@ -554,7 +552,10 @@ export interface LineLayerStyleProps {
|
|
|
554
552
|
*
|
|
555
553
|
* @requires lineTranslate
|
|
556
554
|
*/
|
|
557
|
-
lineTranslateAnchor?: Value<
|
|
555
|
+
lineTranslateAnchor?: Value<
|
|
556
|
+
Enum<LineTranslateAnchorEnum, LineTranslateAnchorEnumValues>,
|
|
557
|
+
['zoom']
|
|
558
|
+
>;
|
|
558
559
|
/**
|
|
559
560
|
* Stroke thickness.
|
|
560
561
|
*/
|
|
@@ -597,20 +598,10 @@ export interface LineLayerStyleProps {
|
|
|
597
598
|
* @disabledBy linePattern
|
|
598
599
|
*/
|
|
599
600
|
lineDasharray?: Value<number[], ['zoom', 'feature']>;
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* The transition affecting any changes to this layer’s lineDasharray property.
|
|
603
|
-
*/
|
|
604
|
-
lineDasharrayTransition?: Transition;
|
|
605
601
|
/**
|
|
606
602
|
* Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
|
|
607
603
|
*/
|
|
608
604
|
linePattern?: Value<ResolvedImageType, ['zoom', 'feature']>;
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* The transition affecting any changes to this layer’s linePattern property.
|
|
612
|
-
*/
|
|
613
|
-
linePatternTransition?: Transition;
|
|
614
605
|
/**
|
|
615
606
|
* Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.
|
|
616
607
|
*
|
|
@@ -970,7 +961,10 @@ export interface SymbolLayerStyleProps {
|
|
|
970
961
|
*
|
|
971
962
|
* @requires iconImage, iconTranslate
|
|
972
963
|
*/
|
|
973
|
-
iconTranslateAnchor?: Value<
|
|
964
|
+
iconTranslateAnchor?: Value<
|
|
965
|
+
Enum<IconTranslateAnchorEnum, IconTranslateAnchorEnumValues>,
|
|
966
|
+
['zoom']
|
|
967
|
+
>;
|
|
974
968
|
/**
|
|
975
969
|
* The opacity at which the text will be drawn.
|
|
976
970
|
*
|
|
@@ -1042,7 +1036,10 @@ export interface SymbolLayerStyleProps {
|
|
|
1042
1036
|
*
|
|
1043
1037
|
* @requires textField, textTranslate
|
|
1044
1038
|
*/
|
|
1045
|
-
textTranslateAnchor?: Value<
|
|
1039
|
+
textTranslateAnchor?: Value<
|
|
1040
|
+
Enum<TextTranslateAnchorEnum, TextTranslateAnchorEnumValues>,
|
|
1041
|
+
['zoom']
|
|
1042
|
+
>;
|
|
1046
1043
|
}
|
|
1047
1044
|
export interface CircleLayerStyleProps {
|
|
1048
1045
|
/**
|
|
@@ -1103,7 +1100,10 @@ export interface CircleLayerStyleProps {
|
|
|
1103
1100
|
*
|
|
1104
1101
|
* @requires circleTranslate
|
|
1105
1102
|
*/
|
|
1106
|
-
circleTranslateAnchor?: Value<
|
|
1103
|
+
circleTranslateAnchor?: Value<
|
|
1104
|
+
Enum<CircleTranslateAnchorEnum, CircleTranslateAnchorEnumValues>,
|
|
1105
|
+
['zoom']
|
|
1106
|
+
>;
|
|
1107
1107
|
/**
|
|
1108
1108
|
* Controls the scaling behavior of the circle when the map is pitched.
|
|
1109
1109
|
*/
|
|
@@ -1226,16 +1226,17 @@ export interface FillExtrusionLayerStyleProps {
|
|
|
1226
1226
|
*
|
|
1227
1227
|
* @requires fillExtrusionTranslate
|
|
1228
1228
|
*/
|
|
1229
|
-
fillExtrusionTranslateAnchor?: Value<
|
|
1229
|
+
fillExtrusionTranslateAnchor?: Value<
|
|
1230
|
+
Enum<
|
|
1231
|
+
FillExtrusionTranslateAnchorEnum,
|
|
1232
|
+
FillExtrusionTranslateAnchorEnumValues
|
|
1233
|
+
>,
|
|
1234
|
+
['zoom']
|
|
1235
|
+
>;
|
|
1230
1236
|
/**
|
|
1231
1237
|
* Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
|
|
1232
1238
|
*/
|
|
1233
1239
|
fillExtrusionPattern?: Value<ResolvedImageType, ['zoom', 'feature']>;
|
|
1234
|
-
|
|
1235
|
-
/**
|
|
1236
|
-
* The transition affecting any changes to this layer’s fillExtrusionPattern property.
|
|
1237
|
-
*/
|
|
1238
|
-
fillExtrusionPatternTransition?: Transition;
|
|
1239
1240
|
/**
|
|
1240
1241
|
* The height with which to extrude this layer.
|
|
1241
1242
|
*/
|
|
@@ -1408,11 +1409,6 @@ export interface BackgroundLayerStyleProps {
|
|
|
1408
1409
|
* Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
|
|
1409
1410
|
*/
|
|
1410
1411
|
backgroundPattern?: Value<ResolvedImageType, ['zoom']>;
|
|
1411
|
-
|
|
1412
|
-
/**
|
|
1413
|
-
* The transition affecting any changes to this layer’s backgroundPattern property.
|
|
1414
|
-
*/
|
|
1415
|
-
backgroundPatternTransition?: Transition;
|
|
1416
1412
|
/**
|
|
1417
1413
|
* The opacity at which the background will be drawn.
|
|
1418
1414
|
*/
|
|
@@ -120,14 +120,6 @@ export const FillLayerStyleProp = PropTypes.shape({
|
|
|
120
120
|
PropTypes.string,
|
|
121
121
|
PropTypes.array,
|
|
122
122
|
]),
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The transition affecting any changes to this layer’s fillPattern property.
|
|
126
|
-
*/
|
|
127
|
-
fillPatternTransition: PropTypes.shape({
|
|
128
|
-
duration: PropTypes.number,
|
|
129
|
-
delay: PropTypes.number,
|
|
130
|
-
}),
|
|
131
123
|
});
|
|
132
124
|
|
|
133
125
|
export const LineLayerStyleProp = PropTypes.shape({
|
|
@@ -283,14 +275,6 @@ export const LineLayerStyleProp = PropTypes.shape({
|
|
|
283
275
|
PropTypes.array,
|
|
284
276
|
]),
|
|
285
277
|
|
|
286
|
-
/**
|
|
287
|
-
* The transition affecting any changes to this layer’s lineDasharray property.
|
|
288
|
-
*/
|
|
289
|
-
lineDasharrayTransition: PropTypes.shape({
|
|
290
|
-
duration: PropTypes.number,
|
|
291
|
-
delay: PropTypes.number,
|
|
292
|
-
}),
|
|
293
|
-
|
|
294
278
|
/**
|
|
295
279
|
* Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
|
|
296
280
|
*/
|
|
@@ -300,14 +284,6 @@ export const LineLayerStyleProp = PropTypes.shape({
|
|
|
300
284
|
PropTypes.array,
|
|
301
285
|
]),
|
|
302
286
|
|
|
303
|
-
/**
|
|
304
|
-
* The transition affecting any changes to this layer’s linePattern property.
|
|
305
|
-
*/
|
|
306
|
-
linePatternTransition: PropTypes.shape({
|
|
307
|
-
duration: PropTypes.number,
|
|
308
|
-
delay: PropTypes.number,
|
|
309
|
-
}),
|
|
310
|
-
|
|
311
287
|
/**
|
|
312
288
|
* Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.
|
|
313
289
|
*
|
|
@@ -1153,14 +1129,6 @@ export const FillExtrusionLayerStyleProp = PropTypes.shape({
|
|
|
1153
1129
|
PropTypes.array,
|
|
1154
1130
|
]),
|
|
1155
1131
|
|
|
1156
|
-
/**
|
|
1157
|
-
* The transition affecting any changes to this layer’s fillExtrusionPattern property.
|
|
1158
|
-
*/
|
|
1159
|
-
fillExtrusionPatternTransition: PropTypes.shape({
|
|
1160
|
-
duration: PropTypes.number,
|
|
1161
|
-
delay: PropTypes.number,
|
|
1162
|
-
}),
|
|
1163
|
-
|
|
1164
1132
|
/**
|
|
1165
1133
|
* The height with which to extrude this layer.
|
|
1166
1134
|
*/
|
|
@@ -1413,14 +1381,6 @@ export const BackgroundLayerStyleProp = PropTypes.shape({
|
|
|
1413
1381
|
PropTypes.array,
|
|
1414
1382
|
]),
|
|
1415
1383
|
|
|
1416
|
-
/**
|
|
1417
|
-
* The transition affecting any changes to this layer’s backgroundPattern property.
|
|
1418
|
-
*/
|
|
1419
|
-
backgroundPatternTransition: PropTypes.shape({
|
|
1420
|
-
duration: PropTypes.number,
|
|
1421
|
-
delay: PropTypes.number,
|
|
1422
|
-
}),
|
|
1423
|
-
|
|
1424
1384
|
/**
|
|
1425
1385
|
* The opacity at which the background will be drawn.
|
|
1426
1386
|
*/
|
|
@@ -1674,7 +1634,6 @@ const styleMap = {
|
|
|
1674
1634
|
fillTranslateTransition: StyleTypes.Transition,
|
|
1675
1635
|
fillTranslateAnchor: StyleTypes.Enum,
|
|
1676
1636
|
fillPattern: StyleTypes.Image,
|
|
1677
|
-
fillPatternTransition: StyleTypes.Transition,
|
|
1678
1637
|
|
|
1679
1638
|
lineCap: StyleTypes.Enum,
|
|
1680
1639
|
lineJoin: StyleTypes.Enum,
|
|
@@ -1697,9 +1656,7 @@ const styleMap = {
|
|
|
1697
1656
|
lineBlur: StyleTypes.Constant,
|
|
1698
1657
|
lineBlurTransition: StyleTypes.Transition,
|
|
1699
1658
|
lineDasharray: StyleTypes.Constant,
|
|
1700
|
-
lineDasharrayTransition: StyleTypes.Transition,
|
|
1701
1659
|
linePattern: StyleTypes.Image,
|
|
1702
|
-
linePatternTransition: StyleTypes.Transition,
|
|
1703
1660
|
lineGradient: StyleTypes.Color,
|
|
1704
1661
|
lineTrimOffset: StyleTypes.Constant,
|
|
1705
1662
|
|
|
@@ -1809,7 +1766,6 @@ const styleMap = {
|
|
|
1809
1766
|
fillExtrusionTranslateTransition: StyleTypes.Transition,
|
|
1810
1767
|
fillExtrusionTranslateAnchor: StyleTypes.Enum,
|
|
1811
1768
|
fillExtrusionPattern: StyleTypes.Image,
|
|
1812
|
-
fillExtrusionPatternTransition: StyleTypes.Transition,
|
|
1813
1769
|
fillExtrusionHeight: StyleTypes.Constant,
|
|
1814
1770
|
fillExtrusionHeightTransition: StyleTypes.Transition,
|
|
1815
1771
|
fillExtrusionBase: StyleTypes.Constant,
|
|
@@ -1845,7 +1801,6 @@ const styleMap = {
|
|
|
1845
1801
|
backgroundColor: StyleTypes.Color,
|
|
1846
1802
|
backgroundColorTransition: StyleTypes.Transition,
|
|
1847
1803
|
backgroundPattern: StyleTypes.Image,
|
|
1848
|
-
backgroundPatternTransition: StyleTypes.Transition,
|
|
1849
1804
|
backgroundOpacity: StyleTypes.Constant,
|
|
1850
1805
|
backgroundOpacityTransition: StyleTypes.Transition,
|
|
1851
1806
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Web support is work in progress, only basic map components works.
|
|
2
|
+
|
|
3
|
+
Extra steps for web:
|
|
4
|
+
1. Add `mapbox-gl' dependency
|
|
5
|
+
```
|
|
6
|
+
yarn add mapbox-gl
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
2. Configure web pack so that `rnmapbox/maps` is transpiled. `@expo/webpack-config` auto transpires packages starting with `react-native-` but `rnmapbox` has not `react-native in it's name, so it will not be transpired. See https://github.com/expo/expo-cli/issues/3744#issuecomment-893911288 and https://github.com/expo/expo-cli/tree/master/packages/webpack-config#include-modules :
|
|
10
|
+
```
|
|
11
|
+
expo customize:web
|
|
12
|
+
|
|
13
|
+
module.exports = async function (env, argv) {
|
|
14
|
+
const config = await createExpoWebpackConfigAsync(
|
|
15
|
+
{
|
|
16
|
+
...env,
|
|
17
|
+
babel: { dangerouslyAddModulePathsToTranspile: ["@rnmapbox/maps"] },
|
|
18
|
+
},
|
|
19
|
+
argv
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return config;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
```
|
|
@@ -195,7 +195,7 @@ class MapView extends (0, _NativeBridgeComponent.default)(_react.default.Compone
|
|
|
195
195
|
*/
|
|
196
196
|
async queryRenderedFeaturesInRect(bbox) {
|
|
197
197
|
let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
198
|
-
let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
198
|
+
let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
199
199
|
if (bbox != null && (bbox.length === 4 || MapboxGL.MapboxV10 && bbox.length === 0)) {
|
|
200
200
|
const res = await this._runNativeCommand('queryRenderedFeaturesInRect', this._nativeRef, [bbox, (0, _filterUtils.getFilter)(filter), layerIDs]);
|
|
201
201
|
if ((0, _utils.isAndroid)()) {
|