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

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 (95) hide show
  1. package/.eslintrc.js +2 -2
  2. package/.nvmrc +1 -1
  3. package/README-v10.md +1 -1
  4. package/README.md +31 -26
  5. package/android/install.md +1 -1
  6. package/android/rctmgl/build.gradle +1 -1
  7. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/RCTMGLPackage.java +8 -3
  8. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/annotation/RCTMGLMarkerView.kt +15 -6
  9. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/annotation/RCTMGLMarkerViewManager.kt +40 -0
  10. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/annotation/RCTMGLMarkerViewWrapper.kt +8 -0
  11. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/annotation/RCTMGLMarkerViewWrapperManager.kt +21 -0
  12. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.kt +26 -1
  13. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt +5 -5
  14. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/modules/RCTMGLModule.kt +1 -0
  15. package/docs/Annotation.md +8 -8
  16. package/docs/Annotations.md +14 -12
  17. package/docs/Atmosphere.md +76 -76
  18. package/docs/BackgroundLayer.md +44 -44
  19. package/docs/Callout.md +4 -4
  20. package/docs/Camera.md +124 -6
  21. package/docs/CircleLayer.md +129 -129
  22. package/docs/CustomHttpHeaders.md +12 -14
  23. package/docs/FillExtrusionLayer.md +120 -120
  24. package/docs/FillLayer.md +83 -83
  25. package/docs/HeadingIndicator.md +3 -3
  26. package/docs/HeatmapLayer.md +58 -58
  27. package/docs/ImageSource.md +4 -3
  28. package/docs/Images.md +3 -3
  29. package/docs/Light.md +45 -45
  30. package/docs/LineLayer.md +166 -166
  31. package/docs/Logger.md +8 -9
  32. package/docs/MapView.md +32 -32
  33. package/docs/MapboxGL.md +26 -27
  34. package/docs/MarkerView.md +11 -6
  35. package/docs/NativeUserLocation.md +3 -3
  36. package/docs/OfflineManager.md +35 -33
  37. package/docs/PointAnnotation.md +12 -6
  38. package/docs/RasterDemSource.md +3 -3
  39. package/docs/RasterLayer.md +99 -99
  40. package/docs/RasterSource.md +5 -3
  41. package/docs/ShapeSource.md +17 -16
  42. package/docs/SkyLayer.md +69 -69
  43. package/docs/Style.md +5 -3
  44. package/docs/StyleSheet.md +74 -278
  45. package/docs/SymbolLayer.md +454 -454
  46. package/docs/Terrain.md +6 -6
  47. package/docs/UserLocation.md +8 -8
  48. package/docs/VectorSource.md +9 -8
  49. package/docs/docs.json +196 -28
  50. package/docs/snapshotManager.md +7 -5
  51. package/index.d.ts +30 -26
  52. package/ios/RCTMGL-v10/RCTMGLCamera.swift +14 -5
  53. package/ios/RCTMGL-v10/RCTMGLMarkerView.swift +28 -14
  54. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapper.swift +24 -0
  55. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapperManager.m +8 -0
  56. package/ios/RCTMGL-v10/RCTMGLMarkerViewWrapperManager.swift +14 -0
  57. package/ios/install.md +25 -14
  58. package/javascript/{utils/animated → classes}/AnimatedCoordinatesArray.js +1 -1
  59. package/javascript/{utils/animated → classes}/AnimatedExtractCoordinateFromArray.js +3 -1
  60. package/javascript/{utils/animated → classes}/AnimatedPoint.js +0 -0
  61. package/javascript/{utils/animated → classes}/AnimatedRouteCoordinatesArray.js +3 -1
  62. package/javascript/{utils/animated → classes}/AnimatedShape.js +9 -3
  63. package/javascript/classes/index.d.ts +5 -0
  64. package/javascript/classes/index.js +5 -0
  65. package/javascript/components/Callout.js +1 -1
  66. package/javascript/components/Camera.tsx +5 -1
  67. package/javascript/components/Images.js +1 -1
  68. package/javascript/components/MapView.js +3 -4
  69. package/javascript/components/MarkerView.tsx +125 -0
  70. package/javascript/components/PointAnnotation.d.ts +13 -0
  71. package/javascript/components/RasterDemSource.js +1 -1
  72. package/javascript/components/RasterSource.js +1 -1
  73. package/javascript/components/ShapeSource.js +4 -4
  74. package/javascript/components/Style.js +1 -1
  75. package/javascript/components/annotations/Annotation.js +3 -3
  76. package/javascript/index.js +27 -14
  77. package/javascript/types/index.ts +1 -1
  78. package/javascript/utils/BridgeValue.ts +89 -0
  79. package/javascript/utils/StyleValue.ts +21 -10
  80. package/javascript/utils/animated/Animated.js +0 -11
  81. package/javascript/utils/deprecation.js +0 -1
  82. package/javascript/utils/geoUtils.d.ts +10 -0
  83. package/javascript/utils/index.d.ts +6 -0
  84. package/package.json +16 -13
  85. package/plugin/build/withMapbox.js +0 -2
  86. package/plugin/install.md +13 -6
  87. package/rnmapbox-maps.podspec +1 -1
  88. package/scripts/autogenHelpers/DocJSONBuilder.js +43 -4
  89. package/scripts/autogenHelpers/globals.js +0 -2
  90. package/scripts/autogenerate.js +1 -2
  91. package/scripts/templates/component.md.ejs +25 -25
  92. package/tsconfig.json +1 -1
  93. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/annotation/RCTMGLMarkerViewManager.java +0 -45
  94. package/javascript/components/MarkerView.js +0 -91
  95. package/javascript/utils/BridgeValue.js +0 -81
@@ -1,45 +0,0 @@
1
- package com.mapbox.rctmgl.components.annotation;
2
-
3
- import com.facebook.react.bridge.ReactApplicationContext;
4
- import com.facebook.react.bridge.ReadableMap;
5
- import com.facebook.react.common.MapBuilder;
6
- import com.facebook.react.uimanager.ThemedReactContext;
7
- import com.facebook.react.uimanager.annotations.ReactProp;
8
- import com.mapbox.rctmgl.components.AbstractEventEmitter;
9
- import com.mapbox.rctmgl.utils.GeoJSONUtils;
10
-
11
- import java.util.Map;
12
-
13
- public class RCTMGLMarkerViewManager extends AbstractEventEmitter<RCTMGLMarkerView> {
14
- public static final String REACT_CLASS = "RCTMGLMarkerView";
15
-
16
- public RCTMGLMarkerViewManager(ReactApplicationContext reactApplicationContext) {
17
- super(reactApplicationContext);
18
- }
19
-
20
- @Override
21
- public String getName() {
22
- return REACT_CLASS;
23
- }
24
-
25
- @ReactProp(name="coordinate")
26
- public void setCoordinate(RCTMGLMarkerView markerView, String geoJSONStr) {
27
- markerView.setCoordinate(GeoJSONUtils.toPointGeometry(geoJSONStr));
28
- }
29
-
30
- @ReactProp(name="anchor")
31
- public void setAnchor(RCTMGLMarkerView markerView, ReadableMap map) {
32
- markerView.setAnchor((float) map.getDouble("x"), (float) map.getDouble("y"));
33
- }
34
-
35
- @Override
36
- protected RCTMGLMarkerView createViewInstance(ThemedReactContext reactContext) {
37
- return new RCTMGLMarkerView(reactContext, this);
38
- }
39
-
40
- @Override
41
- public Map<String, String> customEvents() {
42
- return MapBuilder.<String, String>builder()
43
- .build();
44
- }
45
- }
@@ -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
- }