@rnmapbox/maps 10.0.0-beta.42 → 10.0.0-beta.44

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 (54) hide show
  1. package/android/install.md +69 -2
  2. package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/components/camera/CameraStop.java +4 -4
  3. package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.java +3 -3
  4. package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/modules/RCTMGLSnapshotModule.java +1 -1
  5. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/camera/CameraStop.kt +6 -6
  6. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +1 -0
  7. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/modules/RCTMGLSnapshotModule.java +1 -1
  8. package/docs/HeadingIndicator.md +1 -1
  9. package/docs/ShapeSource.md +13 -9
  10. package/docs/SymbolLayer.md +4 -3
  11. package/docs/docs.json +41 -67
  12. package/index.d.ts +16 -128
  13. package/ios/RCTMGL-v10/RCTMGLCamera.swift +5 -21
  14. package/ios/install.md +3 -2
  15. package/javascript/components/AbstractLayer.tsx +72 -0
  16. package/javascript/components/AbstractSource.tsx +23 -0
  17. package/javascript/components/BackgroundLayer.js +1 -1
  18. package/javascript/components/CircleLayer.js +1 -1
  19. package/javascript/components/FillExtrusionLayer.js +1 -1
  20. package/javascript/components/FillLayer.js +1 -1
  21. package/javascript/components/{HeadingIndicator.js → HeadingIndicator.tsx} +6 -7
  22. package/javascript/components/HeatmapLayer.js +1 -1
  23. package/javascript/components/Images.js +1 -1
  24. package/javascript/components/LineLayer.js +1 -1
  25. package/javascript/components/MapView.js +5 -2
  26. package/javascript/components/MarkerView.tsx +1 -0
  27. package/javascript/components/NativeBridgeComponent.tsx +20 -14
  28. package/javascript/components/PointAnnotation.tsx +2 -1
  29. package/javascript/components/RasterLayer.js +1 -1
  30. package/javascript/components/RasterSource.js +1 -1
  31. package/javascript/components/ShapeSource.tsx +412 -0
  32. package/javascript/components/SkyLayer.js +1 -1
  33. package/javascript/components/Style.js +2 -2
  34. package/javascript/components/SymbolLayer.tsx +111 -0
  35. package/javascript/components/Terrain.tsx +0 -60
  36. package/javascript/components/UserLocation.js +1 -1
  37. package/javascript/components/VectorSource.js +6 -3
  38. package/javascript/components/annotations/Annotation.js +1 -1
  39. package/javascript/global.d.ts +4 -0
  40. package/javascript/index.js +2 -2
  41. package/javascript/utils/MapboxStyles.ts +157 -50
  42. package/javascript/utils/StyleValue.ts +8 -6
  43. package/javascript/utils/animated/Animated.js +2 -2
  44. package/javascript/utils/deprecation.ts +7 -4
  45. package/javascript/utils/{filterUtils.js → filterUtils.tsx} +1 -1
  46. package/javascript/utils/index.d.ts +16 -3
  47. package/package.json +1 -1
  48. package/scripts/autogenHelpers/DocJSONBuilder.js +2 -3
  49. package/scripts/autogenHelpers/globals.js +18 -7
  50. package/scripts/templates/MapboxStyles.ts.ejs +7 -2
  51. package/javascript/components/AbstractLayer.js +0 -46
  52. package/javascript/components/AbstractSource.js +0 -15
  53. package/javascript/components/ShapeSource.js +0 -373
  54. package/javascript/components/SymbolLayer.js +0 -120
@@ -1,120 +0,0 @@
1
- import React from 'react';
2
- import { View, NativeModules, requireNativeComponent } from 'react-native';
3
- import PropTypes from 'prop-types';
4
-
5
- import { viewPropTypes } from '../utils';
6
- import { SymbolLayerStyleProp } from '../utils/styleMap';
7
-
8
- import AbstractLayer from './AbstractLayer';
9
-
10
- const MapboxGL = NativeModules.MGLModule;
11
-
12
- export const NATIVE_MODULE_NAME = 'RCTMGLSymbolLayer';
13
-
14
- /**
15
- * SymbolLayer is a style layer that renders icon and text labels at points or along lines on the map.
16
- */
17
- class SymbolLayer extends AbstractLayer {
18
- static propTypes = {
19
- ...viewPropTypes,
20
-
21
- /**
22
- * A string that uniquely identifies the source in the style to which it is added.
23
- */
24
- id: PropTypes.string.isRequired,
25
-
26
- /**
27
- * The source from which to obtain the data to style.
28
- * If the source has not yet been added to the current style, the behavior is undefined.
29
- * Inferred from parent source only if the layer is a direct child to it.
30
- */
31
- sourceID: PropTypes.string,
32
-
33
- /**
34
- * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style.
35
- */
36
- sourceLayerID: PropTypes.string,
37
-
38
- /**
39
- * Inserts a layer above aboveLayerID.
40
- */
41
- aboveLayerID: PropTypes.string,
42
-
43
- /**
44
- * Inserts a layer below belowLayerID
45
- */
46
- belowLayerID: PropTypes.string,
47
-
48
- /**
49
- * Inserts a layer at a specified index
50
- */
51
- layerIndex: PropTypes.number,
52
-
53
- /**
54
- * Filter only the features in the source layer that satisfy a condition that you define
55
- */
56
- filter: PropTypes.array,
57
-
58
- /**
59
- * The minimum zoom level at which the layer gets parsed and appears.
60
- */
61
- minZoomLevel: PropTypes.number,
62
-
63
- /**
64
- * The maximum zoom level at which the layer gets parsed and appears.
65
- */
66
- maxZoomLevel: PropTypes.number,
67
-
68
- /**
69
- * Customizable style attributes
70
- */
71
- style: PropTypes.oneOfType([
72
- SymbolLayerStyleProp,
73
- PropTypes.arrayOf(SymbolLayerStyleProp),
74
- ]),
75
- };
76
-
77
- static defaultProps = {
78
- sourceID: MapboxGL.StyleSource.DefaultSourceID,
79
- };
80
-
81
- _shouldSnapshot() {
82
- let isSnapshot = false;
83
-
84
- if (React.Children.count(this.props.children) <= 0) {
85
- return isSnapshot;
86
- }
87
-
88
- React.Children.forEach(this.props.children, (child) => {
89
- if (child.type === View) {
90
- isSnapshot = true;
91
- }
92
- });
93
-
94
- return isSnapshot;
95
- }
96
-
97
- render() {
98
- const props = {
99
- ...this.baseProps,
100
- snapshot: this._shouldSnapshot(),
101
- sourceLayerID: this.props.sourceLayerID,
102
- };
103
-
104
- return (
105
- <RCTMGLSymbolLayer ref="nativeLayer" {...props}>
106
- {this.props.children}
107
- </RCTMGLSymbolLayer>
108
- );
109
- }
110
- }
111
-
112
- const RCTMGLSymbolLayer = requireNativeComponent(
113
- NATIVE_MODULE_NAME,
114
- SymbolLayer,
115
- {
116
- nativeOnly: { reactStyle: true, snapshot: true },
117
- },
118
- );
119
-
120
- export default SymbolLayer;