@rnmapbox/maps 10.0.0-beta.31 → 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 (100) hide show
  1. package/.eslintrc.js +2 -2
  2. package/.github/ISSUE_TEMPLATE/bug_report.yml +112 -0
  3. package/.husky/pre-commit +5 -0
  4. package/.nvmrc +1 -1
  5. package/README-v10.md +1 -1
  6. package/README.md +28 -23
  7. package/android/install.md +1 -1
  8. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/camera/CameraStop.kt +27 -31
  9. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +53 -48
  10. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt +5 -5
  11. package/docs/Annotation.md +8 -8
  12. package/docs/Annotations.md +14 -12
  13. package/docs/Atmosphere.md +76 -76
  14. package/docs/BackgroundLayer.md +44 -44
  15. package/docs/Callout.md +4 -4
  16. package/docs/Camera.md +124 -6
  17. package/docs/CircleLayer.md +129 -129
  18. package/docs/CustomHttpHeaders.md +15 -13
  19. package/docs/FillExtrusionLayer.md +120 -120
  20. package/docs/FillLayer.md +83 -83
  21. package/docs/HeadingIndicator.md +3 -3
  22. package/docs/HeatmapLayer.md +58 -58
  23. package/docs/ImageSource.md +4 -3
  24. package/docs/Images.md +3 -3
  25. package/docs/Light.md +45 -45
  26. package/docs/LineLayer.md +166 -166
  27. package/docs/Logger.md +8 -9
  28. package/docs/MapView.md +32 -32
  29. package/docs/MapboxGL.md +26 -27
  30. package/docs/MarkerView.md +11 -6
  31. package/docs/NativeUserLocation.md +3 -3
  32. package/docs/OfflineManager.md +35 -33
  33. package/docs/PointAnnotation.md +12 -6
  34. package/docs/RasterDemSource.md +3 -3
  35. package/docs/RasterLayer.md +99 -99
  36. package/docs/RasterSource.md +5 -3
  37. package/docs/ShapeSource.md +17 -16
  38. package/docs/SkyLayer.md +69 -69
  39. package/docs/Style.md +5 -3
  40. package/docs/StyleSheet.md +74 -278
  41. package/docs/SymbolLayer.md +454 -454
  42. package/docs/Terrain.md +6 -6
  43. package/docs/UserLocation.md +8 -8
  44. package/docs/VectorSource.md +9 -8
  45. package/docs/docs.json +196 -28
  46. package/docs/snapshotManager.md +7 -5
  47. package/index.d.ts +41 -26
  48. package/ios/RCTMGL-v10/CustomHttpHeaders.swift +39 -0
  49. package/ios/RCTMGL-v10/MGLModule.m +3 -0
  50. package/ios/RCTMGL-v10/MGLModule.swift +8 -0
  51. package/ios/RCTMGL-v10/RCTMGLCamera.swift +14 -5
  52. package/ios/RCTMGL-v10/RCTMGLMarkerView.swift +28 -14
  53. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapper.swift +24 -0
  54. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapperManager.m +8 -0
  55. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapperManager.swift +14 -0
  56. package/ios/RCTMGL-v10/RCTMGLOfflineModule.swift +10 -12
  57. package/javascript/{utils/animated → classes}/AnimatedCoordinatesArray.js +1 -1
  58. package/javascript/{utils/animated → classes}/AnimatedExtractCoordinateFromArray.js +3 -1
  59. package/javascript/{utils/animated → classes}/AnimatedPoint.js +0 -0
  60. package/javascript/{utils/animated → classes}/AnimatedRouteCoordinatesArray.js +3 -1
  61. package/javascript/{utils/animated → classes}/AnimatedShape.js +9 -3
  62. package/javascript/classes/index.d.ts +5 -0
  63. package/javascript/classes/index.js +5 -0
  64. package/javascript/components/Callout.js +1 -1
  65. package/javascript/components/Camera.tsx +5 -1
  66. package/javascript/components/Images.js +1 -1
  67. package/javascript/components/MapView.js +3 -4
  68. package/javascript/components/MarkerView.tsx +125 -0
  69. package/javascript/components/PointAnnotation.d.ts +13 -0
  70. package/javascript/components/RasterDemSource.js +1 -1
  71. package/javascript/components/RasterSource.js +1 -1
  72. package/javascript/components/ShapeSource.js +4 -4
  73. package/javascript/components/Style.js +1 -1
  74. package/javascript/components/annotations/Annotation.js +3 -3
  75. package/javascript/index.js +27 -14
  76. package/javascript/types/index.ts +14 -0
  77. package/javascript/utils/BridgeValue.ts +89 -0
  78. package/javascript/utils/StyleValue.ts +22 -10
  79. package/javascript/utils/animated/Animated.js +0 -11
  80. package/javascript/utils/deprecation.js +0 -1
  81. package/javascript/utils/geoUtils.d.ts +10 -0
  82. package/javascript/utils/index.d.ts +6 -0
  83. package/javascript/utils/{styleMap.js → styleMap.ts} +110 -354
  84. package/javascript/web/MapContext.ts +6 -0
  85. package/javascript/web/components/Camera.tsx +39 -0
  86. package/javascript/web/components/MapView.tsx +51 -0
  87. package/package.json +21 -20
  88. package/plugin/build/withMapbox.js +0 -2
  89. package/plugin/install.md +13 -6
  90. package/scripts/autogenHelpers/DocJSONBuilder.js +43 -4
  91. package/scripts/autogenHelpers/globals.js +0 -2
  92. package/scripts/autogenerate.js +3 -4
  93. package/scripts/templates/component.md.ejs +25 -25
  94. package/scripts/templates/{styleMap.js.ejs → styleMap.ts.ejs} +7 -4
  95. package/tsconfig.json +1 -1
  96. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -75
  97. package/javascript/components/MarkerView.js +0 -91
  98. package/javascript/utils/BridgeValue.js +0 -81
  99. package/javascript/utils/resolveAssetSource.d.ts +0 -5
  100. package/javascript/web/MapContext.js +0 -5
@@ -1,91 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Platform, NativeModules, requireNativeComponent } from 'react-native';
4
-
5
- import { toJSONString, viewPropTypes } from '../utils';
6
- import { makePoint } from '../utils/geoUtils';
7
-
8
- import PointAnnotation from './PointAnnotation';
9
-
10
- const MapboxGL = NativeModules.MGLModule;
11
-
12
- export const NATIVE_MODULE_NAME = 'RCTMGLMarkerView';
13
-
14
- /**
15
- * MarkerView allows you to place a interactive react native marker to the map.
16
- *
17
- * If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance
18
- * .
19
- * This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android
20
- * and PointAnnotation on iOS.
21
- */
22
- class MarkerView extends React.PureComponent {
23
- static propTypes = {
24
- ...viewPropTypes,
25
-
26
- /**
27
- * The center point (specified as a map coordinate) of the marker.
28
- * See also #anchor.
29
- */
30
- coordinate: PropTypes.arrayOf(PropTypes.number).isRequired,
31
-
32
- /**
33
- * Specifies the anchor being set on a particular point of the annotation.
34
- * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
35
- * where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
36
- * Note this is only for custom annotations not the default pin view.
37
- * Defaults to the center of the view.
38
- */
39
- anchor: PropTypes.shape({
40
- /**
41
- * `x` of anchor
42
- */
43
- x: PropTypes.number.isRequired,
44
- /**
45
- * `y` of anchor
46
- */
47
- y: PropTypes.number.isRequired,
48
- }),
49
-
50
- /**
51
- * Expects one child - can be container with multiple elements
52
- */
53
- children: PropTypes.element.isRequired,
54
- };
55
-
56
- static defaultProps = {
57
- anchor: { x: 0.5, y: 0.5 },
58
- };
59
-
60
- _getCoordinate() {
61
- if (!this.props.coordinate) {
62
- return undefined;
63
- }
64
- return toJSONString(makePoint(this.props.coordinate));
65
- }
66
-
67
- render() {
68
- if (Platform.OS === 'ios' && !MapboxGL.MapboxV10) {
69
- return <PointAnnotation {...this.props} />;
70
- }
71
-
72
- const props = {
73
- ...this.props,
74
- anchor: this.props.anchor,
75
- coordinate: this._getCoordinate(),
76
- };
77
-
78
- return (
79
- <RCTMGLMarkerView {...props}>{this.props.children}</RCTMGLMarkerView>
80
- );
81
- }
82
- }
83
-
84
- const RCTMGLMarkerView =
85
- Platform.OS === 'android'
86
- ? requireNativeComponent(NATIVE_MODULE_NAME, MarkerView, {})
87
- : MapboxGL.MapboxV10
88
- ? requireNativeComponent(NATIVE_MODULE_NAME, MarkerView, {})
89
- : undefined;
90
-
91
- export default MarkerView;
@@ -1,81 +0,0 @@
1
- import { isBoolean, isNumber, isString } from './index';
2
-
3
- const Types = {
4
- Array: 'array',
5
- Bool: 'boolean',
6
- Number: 'number',
7
- String: 'string',
8
- HashMap: 'hashmap',
9
- };
10
-
11
- export default class BridgeValue {
12
- constructor(rawValue) {
13
- this.rawValue = rawValue;
14
- }
15
-
16
- get type() {
17
- if (Array.isArray(this.rawValue)) {
18
- return Types.Array;
19
- }
20
- if (isBoolean(this.rawValue)) {
21
- return Types.Bool;
22
- }
23
- if (isNumber(this.rawValue)) {
24
- return Types.Number;
25
- }
26
- if (isString(this.rawValue)) {
27
- return Types.String;
28
- }
29
- if (this.rawValue && typeof this.rawValue === 'object') {
30
- return Types.HashMap;
31
- }
32
- throw new Error(
33
- `[type - ${this.rawValue}] BridgeValue must be a primitive/array/object`,
34
- );
35
- }
36
-
37
- get value() {
38
- const { type } = this;
39
-
40
- let value;
41
-
42
- if (type === Types.Array) {
43
- value = [];
44
-
45
- for (const innerRawValue of this.rawValue) {
46
- const bridgeValue = new BridgeValue(innerRawValue);
47
- value.push(bridgeValue.toJSON());
48
- }
49
- } else if (type === Types.HashMap) {
50
- value = [];
51
-
52
- const stringKeys = Object.keys(this.rawValue);
53
- for (const stringKey of stringKeys) {
54
- value.push([
55
- new BridgeValue(stringKey).toJSON(),
56
- new BridgeValue(this.rawValue[stringKey]).toJSON(),
57
- ]);
58
- }
59
- } else if (
60
- type === Types.Bool ||
61
- type === Types.Number ||
62
- type === Types.String
63
- ) {
64
- value = this.rawValue;
65
- } else {
66
- throw new Error(
67
- `[value - ${this.rawValue}] BridgeValue must be a primitive/array/object`,
68
- );
69
- }
70
-
71
- return value;
72
- }
73
-
74
- toJSON(formatter) {
75
- return {
76
- type: this.type,
77
- value:
78
- typeof formatter === 'function' ? formatter(this.value) : this.value,
79
- };
80
- }
81
- }
@@ -1,5 +0,0 @@
1
- declare module 'react-native/Libraries/Image/resolveAssetSource' {
2
- export default function resolveAssetSource(x: number): {
3
- [key: string]: string;
4
- };
5
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
-
3
- const MapContext = React.createContext({});
4
-
5
- export default MapContext;