@rnmapbox/maps 10.0.0-beta.33 → 10.0.0-beta.34

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.
Files changed (85) hide show
  1. package/.eslintrc.js +2 -2
  2. package/.nvmrc +1 -1
  3. package/README-v10.md +1 -1
  4. package/README.md +28 -23
  5. package/android/install.md +1 -1
  6. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +5 -1
  7. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt +5 -5
  8. package/docs/Annotation.md +8 -8
  9. package/docs/Annotations.md +14 -12
  10. package/docs/Atmosphere.md +76 -76
  11. package/docs/BackgroundLayer.md +44 -44
  12. package/docs/Callout.md +4 -4
  13. package/docs/Camera.md +124 -6
  14. package/docs/CircleLayer.md +129 -129
  15. package/docs/CustomHttpHeaders.md +12 -14
  16. package/docs/FillExtrusionLayer.md +120 -120
  17. package/docs/FillLayer.md +83 -83
  18. package/docs/HeadingIndicator.md +3 -3
  19. package/docs/HeatmapLayer.md +58 -58
  20. package/docs/ImageSource.md +4 -3
  21. package/docs/Images.md +3 -3
  22. package/docs/Light.md +45 -45
  23. package/docs/LineLayer.md +166 -166
  24. package/docs/Logger.md +8 -9
  25. package/docs/MapView.md +32 -32
  26. package/docs/MapboxGL.md +26 -27
  27. package/docs/MarkerView.md +11 -6
  28. package/docs/NativeUserLocation.md +3 -3
  29. package/docs/OfflineManager.md +35 -33
  30. package/docs/PointAnnotation.md +12 -6
  31. package/docs/RasterDemSource.md +3 -3
  32. package/docs/RasterLayer.md +99 -99
  33. package/docs/RasterSource.md +5 -3
  34. package/docs/ShapeSource.md +17 -16
  35. package/docs/SkyLayer.md +69 -69
  36. package/docs/Style.md +5 -3
  37. package/docs/StyleSheet.md +74 -278
  38. package/docs/SymbolLayer.md +454 -454
  39. package/docs/Terrain.md +6 -6
  40. package/docs/UserLocation.md +8 -8
  41. package/docs/VectorSource.md +9 -8
  42. package/docs/docs.json +196 -28
  43. package/docs/snapshotManager.md +7 -5
  44. package/index.d.ts +30 -26
  45. package/ios/RCTMGL-v10/RCTMGLCamera.swift +14 -5
  46. package/ios/RCTMGL-v10/RCTMGLMarkerView.swift +28 -14
  47. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapper.swift +24 -0
  48. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapperManager.m +8 -0
  49. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapperManager.swift +14 -0
  50. package/javascript/{utils/animated → classes}/AnimatedCoordinatesArray.js +1 -1
  51. package/javascript/{utils/animated → classes}/AnimatedExtractCoordinateFromArray.js +3 -1
  52. package/javascript/{utils/animated → classes}/AnimatedPoint.js +0 -0
  53. package/javascript/{utils/animated → classes}/AnimatedRouteCoordinatesArray.js +3 -1
  54. package/javascript/{utils/animated → classes}/AnimatedShape.js +9 -3
  55. package/javascript/classes/index.d.ts +5 -0
  56. package/javascript/classes/index.js +5 -0
  57. package/javascript/components/Callout.js +1 -1
  58. package/javascript/components/Camera.tsx +5 -1
  59. package/javascript/components/Images.js +1 -1
  60. package/javascript/components/MapView.js +3 -4
  61. package/javascript/components/MarkerView.tsx +125 -0
  62. package/javascript/components/PointAnnotation.d.ts +13 -0
  63. package/javascript/components/RasterDemSource.js +1 -1
  64. package/javascript/components/RasterSource.js +1 -1
  65. package/javascript/components/ShapeSource.js +4 -4
  66. package/javascript/components/Style.js +1 -1
  67. package/javascript/components/annotations/Annotation.js +3 -3
  68. package/javascript/index.js +27 -14
  69. package/javascript/types/index.ts +1 -1
  70. package/javascript/utils/BridgeValue.ts +89 -0
  71. package/javascript/utils/StyleValue.ts +22 -10
  72. package/javascript/utils/animated/Animated.js +0 -11
  73. package/javascript/utils/deprecation.js +0 -1
  74. package/javascript/utils/geoUtils.d.ts +10 -0
  75. package/javascript/utils/index.d.ts +6 -0
  76. package/package.json +16 -13
  77. package/plugin/build/withMapbox.js +0 -2
  78. package/plugin/install.md +13 -6
  79. package/scripts/autogenHelpers/DocJSONBuilder.js +43 -4
  80. package/scripts/autogenHelpers/globals.js +0 -2
  81. package/scripts/autogenerate.js +1 -2
  82. package/scripts/templates/component.md.ejs +25 -25
  83. package/tsconfig.json +1 -1
  84. package/javascript/components/MarkerView.js +0 -91
  85. package/javascript/utils/BridgeValue.js +0 -81
@@ -1,18 +1,18 @@
1
- ## StyleSheet
1
+ # StyleSheet
2
2
 
3
+ StyleSheet is written as a JS object.
4
+ See [Mapbox expression specs](https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions) for reference on
5
+ expressions.
3
6
 
4
- ### Stylesheet is now a JS object, see [CHANGELOG.md](../CHANGELOG.md) for more details
7
+ ## Style Functions
5
8
 
6
- See (Mapbox expression specs)[https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions] for reference on expressions.
9
+ ### Zoom based Expressions
7
10
 
8
- ### Style functions
11
+ This is a value function defining a style value that changes as the zoom level changes. The layout and paint attribute
12
+ properties of the layer can be set to style function objects. Use a camera function to create the illusion of depth and
13
+ control data density.
9
14
 
10
- #### zoom based expressions (replaces camera(stops[, interpolationMode]))
11
-
12
- This is a value function defining a style value that changes as the zoom level changes. The layout and paint attribute properties of the layer can be set to style function objects. Use a camera function to create the illusion of depth and control data density.
13
-
14
- new:
15
- ```js
15
+ ```typescript
16
16
  // color would change based on zoom level keys.
17
17
  [
18
18
  'interpolate',
@@ -20,44 +20,22 @@ new:
20
20
  ['zoom'],
21
21
  0, 'blue',
22
22
  10, 'green',
23
- 20, 'yellow'
23
+ 20, 'yellow',
24
24
  ];
25
25
 
26
26
  // Example of use inside stylesheet
27
27
  {
28
- fillColor: [
29
- 'step',
30
- ['zoom'],
31
- 'blue',
32
- 20, 'green'
33
- ]
28
+ fillColor: ['step', ['zoom'], 'blue', 20, 'green'];
34
29
  }
35
30
  ```
36
31
 
37
- old:
38
- ```js
39
- // color would change based on zoom level keys.
40
- MapboxGL.StyleSheet.camera({
41
- 0: 'blue',
42
- 10: 'green',
43
- 20: 'yellow',
44
- }, MapboxGL.InterpolationMode.Exponential);
32
+ ### Attribute based Expressions
45
33
 
46
- // Example of use inside stylesheet
47
- MapboxGL.StyleSheet.create({
48
- fillColor: MapboxGL.StyleSheet.camera({
49
- 15: 'blue',
50
- 20: 'green',
51
- }, MapboxGL.InterpolationMode.Interval),
52
- });
53
- ```
34
+ This is a value function defining a style value that changes with its properties. The layout and paint attribute
35
+ properties of the layer can be set to style function objects. Use source functions to visually differentiate types of
36
+ features within the same layer or create data visualizations.
54
37
 
55
- #### attribute based expressions (replaces source(stops, attributeName[, interpolationMode]))
56
-
57
- This is a value function defining a style value that changes with its properties. The layout and paint attribute properties of the layer can be set to style function objects. Use source functions to visually differentate types of features within the same layer or create data visualizations.
58
-
59
- new:
60
- ```js
38
+ ```typescript
61
39
  // would color the layer based the property rating=[1, 5]
62
40
  [
63
41
  'step',
@@ -79,126 +57,42 @@ new:
79
57
  3, 'yellow',
80
58
  4, 'yellowgreen',
81
59
  5, 'green',
82
- ],
60
+ ];
83
61
  }
84
62
  ```
85
63
 
64
+ ### Nested Expressions
86
65
 
87
- old:
88
- ```js
89
- // would color the layer based the property rating=[1, 5]
90
- MapboxGL.StyleSheet.source([
91
- [1, 'red'],
92
- [2, 'orange'],
93
- [3, 'yellow'],
94
- [4, 'yellowgreen'],
95
- [5, 'green'],
96
- ], 'rating', MapboxGL.InterpolationMode.Categorical);
97
-
98
- // Example of use inside stylesheet
99
- MapboxGL.StyleSheet.create({
100
- circleColor: MapboxGL.StyleSheet.source([
101
- [1, 'red'],
102
- [2, 'orange'],
103
- [3, 'yellow'],
104
- [4, 'yellowgreen'],
105
- [5, 'green'],
106
- ], 'rating', MapboxGL.InterpolationMode.Categorical),
107
- });
108
- ```
109
-
110
- #### nested expressions (replaces composite(stops, attributeName[, interpolationMode]))
111
-
112
- This is a value function defining a style value that changes with the feature attributes at each map zoom level. The layout and paint attribute properties of the layer can be set to style function objects. Use composite functions to allow the appearance of a map feature to change with both its attributes and the map zoom level. Note that support for composite functions is not yet complete in the Android/iOS SDK's.
66
+ This is a value function defining a style value that changes with the feature attributes at each map zoom level. The
67
+ layout and paint attribute properties of the layer can be set to style function objects. Use composite functions to
68
+ allow the appearance of a map feature to change with both its attributes and the map zoom level. Note that support for
69
+ composite functions is not yet complete in the Android/iOS SDK's.
113
70
 
114
- new:
115
- ```js
71
+ ```typescript
116
72
  // would change based on the zoom level and rating value
117
73
  // {zoom_level}: [{value}, {style_value}]
118
74
  [
119
75
  'step',
120
76
  ['zoom'],
121
- [
122
- 'step',
123
- ['get','rating'],
124
- 0,
125
- 5, 5
126
- ],
127
- 20, [
128
- 'step',
129
- ['get','rating'],
130
- 0,
131
- 5, 20
132
- ]
133
- ]
77
+ ['step', ['get', 'rating'], 0, 5, 5],
78
+ 20,
79
+ ['step', ['get', 'rating'], 0, 5, 20],
80
+ ];
134
81
 
135
82
  {
136
83
  circleRadius: [
137
84
  'step',
138
85
  ['zoom'],
139
- [ 'step',
140
- ['get','rating'],
141
- 0,
142
- 5, 5
143
- ],
144
- 20, [ 'step',
145
- ['get','rating'],
146
- 0,
147
- 5, 20
148
- ],
149
- ]
150
- };
151
- ```
152
-
153
-
154
- old:
155
- ```js
156
- // would change based on the zoom level and rating value
157
- // {zoom_level}: [{value}, {style_value}]
158
- MapboxGL.StyleSheet.composite({
159
- 0: [0, 0],
160
- 0: [5, 5],
161
- 20: [0, 0],
162
- 20: [5, 20],
163
- }, 'rating', MapboxGL.InterpolationMode.Interval);
164
-
165
- MapboxGL.StyleSheet.create({
166
- circleRadius: MapboxGL.StyleSheet.composite({
167
- 0: [0, 0],
168
- 0: [5, 5],
169
- 20: [0, 0],
170
- 20: [5, 20],
171
- }, 'rating', MapboxGL.InterpolationMode.Interval),
172
- });
173
- ```
174
-
175
- ### Simple expressions
176
-
177
- #### ['get', attributeName] - replaces identity(attributeName)
178
-
179
- This is just a source style function under the hood. For example say if you had a feature property with an attribute height. Identity means that it will just equal the attribute value, so there is no need to provide any stops
180
-
181
- new:
182
- ```js
183
- {
184
- fillExtrusionHeight: ['get', 'height'],
86
+ ['step', ['get', 'rating'], 0, 5, 5],
87
+ 20,
88
+ ['step', ['get', 'rating'], 0, 5, 20],
89
+ ];
185
90
  }
186
91
  ```
187
92
 
188
- old:
189
-
190
- ```js
191
- MapboxGL.StyleSheet.create({
192
- fillExtrusionHeight: MapboxGL.StyleSheet.identity('height'),
193
- });
194
- ```
195
-
196
- ### StyleSheet Examples
197
-
93
+ ## StyleSheet Examples
198
94
 
199
- #### new:
200
-
201
- ```js
95
+ ```tsx
202
96
  const styles = {
203
97
  buildings: {
204
98
  fillColor: 'blue',
@@ -208,13 +102,19 @@ const styles = {
208
102
  }
209
103
  };
210
104
 
211
- ...
105
+ // ...
212
106
 
213
- <MapboxGL.FillLayer ... style={styles.buildings} />
214
- <MapboxGL.FillLayer ... style={styles.street} />
107
+ <MapboxGL.FillLayer
108
+ style={styles.buildings}
109
+ // ...
110
+ />
111
+ < MapboxGL.FillLayer
112
+ style={styles.street}
113
+ // ...
114
+ />
215
115
  ```
216
116
 
217
- ```js
117
+ ```tsx
218
118
  const layerStyles = {
219
119
  singlePoint: {
220
120
  circleColor: 'green',
@@ -228,7 +128,7 @@ const layerStyles = {
228
128
  circleColor: [
229
129
  'interpolate',
230
130
  ['exponential', 1.5],
231
- ['get','point_count'],
131
+ ['get', 'point_count'],
232
132
  25, 'yellow',
233
133
  50, 'red',
234
134
  75, 'blue',
@@ -240,7 +140,7 @@ const layerStyles = {
240
140
  circleRadius: [
241
141
  'interpolate',
242
142
  ['exponential', 1.5],
243
- ['get','point_count'],
143
+ ['get', 'point_count'],
244
144
  [0, 15],
245
145
  [100, 20],
246
146
  [750, 30],
@@ -255,28 +155,35 @@ const layerStyles = {
255
155
  textField: ['get', 'point_count'],
256
156
  textSize: 12,
257
157
  },
258
- });
158
+ };
259
159
 
260
- ...
160
+ // ...
261
161
 
262
162
  <MapboxGL.SymbolLayer
263
163
  id='pointCount'
264
- style={layerStyles.clusterCount} />
164
+ style={layerStyles.clusterCount}
165
+ />
265
166
 
266
- <MapboxGL.CircleLayer
167
+ < MapboxGL.CircleLayer
267
168
  id='clusteredPoints'
268
169
  belowLayerID='pointCount'
269
- filter={['has', 'point_count']}
270
- style={layerStyles.clusteredPoints} />
170
+ filter={['has', 'point_count'
171
+ ]
172
+ }
173
+ style={layerStyles.clusteredPoints}
174
+ />
271
175
 
272
- <MapboxGL.CircleLayer
176
+ < MapboxGL.CircleLayer
273
177
  id='singlePoint'
274
- filter={['!has', 'point_count']}
275
- style={layerStyles.singlePoint} />
178
+ filter={['!has', 'point_count'
179
+ ]
180
+ }
181
+ style={layerStyles.singlePoint}
182
+ />
276
183
  ```
277
184
 
278
- ```javascript
279
- const layerStyles = MapboxGL.StyleSheet.create({
185
+ ```tsx
186
+ const layerStyles = {
280
187
  building: {
281
188
  fillExtrusionOpacity: 1,
282
189
  fillExtrusionHeight: ['get', 'height'],
@@ -288,9 +195,8 @@ const layerStyles = MapboxGL.StyleSheet.create({
288
195
  [0, 'white'],
289
196
  [50, 'blue'],
290
197
  [100, 'red'],
291
- ],
292
- },
293
- fillExtrusionColorTransition: { duration: 2000, delay: 0 },
198
+ ],
199
+ fillExtrusionColorTransition: {duration: 2000, delay: 0},
294
200
  },
295
201
  streets: {
296
202
  lineColor: 'blue',
@@ -298,133 +204,23 @@ const layerStyles = MapboxGL.StyleSheet.create({
298
204
  lineOpacity: 0.50,
299
205
  lineJoin: MapboxGL.LineJoin.Round,
300
206
  lineCap: MapboxGL.LineCap.Round,
301
- lineDasharray: [2, 2],
302
- },
303
- });
304
-
305
- ...
306
-
307
- <MapboxGL.FillExtrusionLayer
308
- id='building3d'
309
- sourceLayerID='building'
310
- style={layerStyles.building} />
311
-
312
- <MapboxGL.LineLayer
313
- id='streetLineColor'
314
- sourceLayerID='road'
315
- minZoomLevel={14}
316
- belowLayerID='building3d'
317
- style={layerStyles.streets} />
318
- ```
319
-
320
- #### old:
321
-
322
- ```js
323
- const styles = MapboxGL.StyleSheet.create({
324
- buildings: {
325
- fillColor: 'blue',
326
- },
327
- street: {
328
- lineColor: 'green',
207
+ lineDasharray: [2, 2]
329
208
  }
330
- });
331
-
332
- ...
333
-
334
- <MapboxGL.FillLayer ... style={styles.buildings} />
335
- <MapboxGL.FillLayer ... style={styles.street} />
336
- ```
337
-
338
- ```js
339
- const layerStyles = MapboxGL.StyleSheet.create({
340
- singlePoint: {
341
- circleColor: 'green',
342
- circleOpacity: 0.84,
343
- circleStrokeWidth: 2,
344
- circleStrokeColor: 'white',
345
- circleRadius: 5,
346
- },
347
-
348
- clusteredPoints: {
349
- circleColor: MapboxGL.StyleSheet.source([
350
- [25, 'yellow'],
351
- [50, 'red'],
352
- [75, 'blue'],
353
- [100, 'orange'],
354
- [300, 'pink'],
355
- [750, 'white'],
356
- ], 'point_count', MapboxGL.InterpolationMode.Exponential),
357
-
358
- circleRadius: MapboxGL.StyleSheet.source([
359
- [0, 15],
360
- [100, 20],
361
- [750, 30],
362
- ], 'point_count', MapboxGL.InterpolationMode.Exponential),
363
-
364
- circleOpacity: 0.84,
365
- circleStrokeWidth: 2,
366
- circleStrokeColor: 'white',
367
- },
368
-
369
- clusterCount: {
370
- textField: '{point_count}',
371
- textSize: 12,
372
- },
373
- });
374
-
375
- ...
376
-
377
- <MapboxGL.SymbolLayer
378
- id='pointCount'
379
- style={layerStyles.clusterCount} />
380
-
381
- <MapboxGL.CircleLayer
382
- id='clusteredPoints'
383
- belowLayerID='pointCount'
384
- filter={['has', 'point_count']}
385
- style={layerStyles.clusteredPoints} />
386
-
387
- <MapboxGL.CircleLayer
388
- id='singlePoint'
389
- filter={['!has', 'point_count']}
390
- style={layerStyles.singlePoint} />
391
- ```
392
-
393
- ```javascript
394
- const layerStyles = MapboxGL.StyleSheet.create({
395
- building: {
396
- fillExtrusionOpacity: 1,
397
- fillExtrusionHeight: MapboxGL.StyleSheet.identity('height'),
398
- fillExtrusionBase: MapboxGL.StyleSheet.identity('min_height'),
399
- fillExtrusionColor: MapboxGL.StyleSheet.source([
400
- [0, 'white'],
401
- [50, 'blue'],
402
- [100, 'red'],
403
- ], 'height', MapboxGL.InterpolationMode.Exponential),
404
- fillExtrusionColorTransition: { duration: 2000, delay: 0 },
405
- },
406
- streets: {
407
- lineColor: 'blue',
408
- lineWidth: 2,
409
- lineOpacity: 0.50,
410
- lineJoin: MapboxGL.LineJoin.Round,
411
- lineCap: MapboxGL.LineCap.Round,
412
- lineDasharray: [2, 2],
413
- },
414
- });
209
+ };
415
210
 
416
- ...
211
+ // ...
417
212
 
418
213
  <MapboxGL.FillExtrusionLayer
419
214
  id='building3d'
420
215
  sourceLayerID='building'
421
- style={layerStyles.building} />
216
+ style={layerStyles.building}
217
+ />
422
218
 
423
- <MapboxGL.LineLayer
219
+ < MapboxGL.LineLayer
424
220
  id='streetLineColor'
425
221
  sourceLayerID='road'
426
222
  minZoomLevel={14}
427
223
  belowLayerID='building3d'
428
- style={layerStyles.streets} />
224
+ style={layerStyles.streets}
225
+ />
429
226
  ```
430
-