@rnmapbox/maps 10.0.0-beta.73 → 10.0.0-beta.74

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 (104) hide show
  1. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/location/LocationComponentManager.kt +4 -2
  2. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt +7 -2
  3. package/index.d.ts +19 -72
  4. package/javascript/components/AbstractLayer.tsx +2 -1
  5. package/javascript/components/AbstractSource.tsx +3 -1
  6. package/javascript/components/Atmosphere.tsx +2 -1
  7. package/javascript/components/Camera.tsx +6 -4
  8. package/javascript/components/Images.tsx +1 -1
  9. package/javascript/components/Light.tsx +60 -0
  10. package/javascript/components/PointAnnotation.tsx +2 -1
  11. package/javascript/components/ShapeSource.tsx +1 -11
  12. package/javascript/components/Terrain.tsx +2 -1
  13. package/javascript/components/VectorSource.tsx +209 -0
  14. package/javascript/modules/location/locationManager.ts +1 -1
  15. package/javascript/types/BaseProps.ts +3 -0
  16. package/javascript/types/OnPressEvent.ts +11 -0
  17. package/javascript/utils/{Logger.js → Logger.ts} +32 -14
  18. package/javascript/utils/MapboxStyles.d.ts +1 -1
  19. package/javascript/utils/deprecation.ts +3 -3
  20. package/javascript/utils/nativeRef.ts +28 -0
  21. package/lib/commonjs/components/AbstractLayer.js.map +1 -1
  22. package/lib/commonjs/components/AbstractSource.js.map +1 -1
  23. package/lib/commonjs/components/Atmosphere.js.map +1 -1
  24. package/lib/commonjs/components/Camera.js +4 -4
  25. package/lib/commonjs/components/Camera.js.map +1 -1
  26. package/lib/commonjs/components/Images.js +1 -1
  27. package/lib/commonjs/components/Images.js.map +1 -1
  28. package/lib/commonjs/components/Light.js +32 -33
  29. package/lib/commonjs/components/Light.js.map +1 -1
  30. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  31. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  32. package/lib/commonjs/components/Terrain.js.map +1 -1
  33. package/lib/commonjs/components/VectorSource.js +15 -74
  34. package/lib/commonjs/components/VectorSource.js.map +1 -1
  35. package/lib/commonjs/modules/location/locationManager.js +2 -1
  36. package/lib/commonjs/modules/location/locationManager.js.map +1 -1
  37. package/lib/commonjs/types/BaseProps.js +2 -0
  38. package/lib/commonjs/types/BaseProps.js.map +1 -0
  39. package/lib/commonjs/types/OnPressEvent.js +2 -0
  40. package/lib/commonjs/types/OnPressEvent.js.map +1 -0
  41. package/lib/commonjs/utils/Logger.js +7 -7
  42. package/lib/commonjs/utils/Logger.js.map +1 -1
  43. package/lib/commonjs/utils/deprecation.js +2 -2
  44. package/lib/commonjs/utils/nativeRef.js +27 -0
  45. package/lib/commonjs/utils/nativeRef.js.map +1 -0
  46. package/lib/module/components/AbstractLayer.js.map +1 -1
  47. package/lib/module/components/AbstractSource.js.map +1 -1
  48. package/lib/module/components/Atmosphere.js.map +1 -1
  49. package/lib/module/components/Camera.js +4 -4
  50. package/lib/module/components/Camera.js.map +1 -1
  51. package/lib/module/components/Images.js +1 -1
  52. package/lib/module/components/Images.js.map +1 -1
  53. package/lib/module/components/Light.js +29 -32
  54. package/lib/module/components/Light.js.map +1 -1
  55. package/lib/module/components/PointAnnotation.js.map +1 -1
  56. package/lib/module/components/ShapeSource.js.map +1 -1
  57. package/lib/module/components/Terrain.js.map +1 -1
  58. package/lib/module/components/VectorSource.js +15 -74
  59. package/lib/module/components/VectorSource.js.map +1 -1
  60. package/lib/module/modules/location/locationManager.js +1 -1
  61. package/lib/module/modules/location/locationManager.js.map +1 -1
  62. package/lib/module/types/BaseProps.js +2 -0
  63. package/lib/module/types/BaseProps.js.map +1 -0
  64. package/lib/module/types/OnPressEvent.js +2 -0
  65. package/lib/module/types/OnPressEvent.js.map +1 -0
  66. package/lib/module/utils/Logger.js +7 -7
  67. package/lib/module/utils/Logger.js.map +1 -1
  68. package/lib/module/utils/deprecation.js +2 -2
  69. package/lib/module/utils/nativeRef.js +21 -0
  70. package/lib/module/utils/nativeRef.js.map +1 -0
  71. package/lib/typescript/components/AbstractLayer.d.ts +2 -1
  72. package/lib/typescript/components/AbstractLayer.d.ts.map +1 -1
  73. package/lib/typescript/components/AbstractSource.d.ts +2 -1
  74. package/lib/typescript/components/AbstractSource.d.ts.map +1 -1
  75. package/lib/typescript/components/Atmosphere.d.ts +2 -1
  76. package/lib/typescript/components/Atmosphere.d.ts.map +1 -1
  77. package/lib/typescript/components/Camera.d.ts.map +1 -1
  78. package/lib/typescript/components/Images.d.ts +1 -1
  79. package/lib/typescript/components/Images.d.ts.map +1 -1
  80. package/lib/typescript/components/Light.d.ts +17 -0
  81. package/lib/typescript/components/Light.d.ts.map +1 -0
  82. package/lib/typescript/components/PointAnnotation.d.ts +2 -1
  83. package/lib/typescript/components/PointAnnotation.d.ts.map +1 -1
  84. package/lib/typescript/components/ShapeSource.d.ts +3 -13
  85. package/lib/typescript/components/ShapeSource.d.ts.map +1 -1
  86. package/lib/typescript/components/Terrain.d.ts +2 -1
  87. package/lib/typescript/components/Terrain.d.ts.map +1 -1
  88. package/lib/typescript/components/VectorSource.d.ts +144 -0
  89. package/lib/typescript/components/VectorSource.d.ts.map +1 -0
  90. package/lib/typescript/modules/location/locationManager.d.ts +1 -1
  91. package/lib/typescript/modules/location/locationManager.d.ts.map +1 -1
  92. package/lib/typescript/types/BaseProps.d.ts +4 -0
  93. package/lib/typescript/types/BaseProps.d.ts.map +1 -0
  94. package/lib/typescript/types/OnPressEvent.d.ts +12 -0
  95. package/lib/typescript/types/OnPressEvent.d.ts.map +1 -0
  96. package/lib/typescript/utils/Logger.d.ts +53 -0
  97. package/lib/typescript/utils/Logger.d.ts.map +1 -0
  98. package/lib/typescript/utils/deprecation.d.ts +4 -3
  99. package/lib/typescript/utils/deprecation.d.ts.map +1 -1
  100. package/lib/typescript/utils/nativeRef.d.ts +21 -0
  101. package/lib/typescript/utils/nativeRef.d.ts.map +1 -0
  102. package/package.json +1 -1
  103. package/javascript/components/Light.js +0 -47
  104. package/javascript/components/VectorSource.js +0 -203
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ import { NativeMethods, NativeSyntheticEvent } from 'react-native';
3
+ import { OnPressEvent } from '../types/OnPressEvent';
4
+ import AbstractSource from './AbstractSource';
5
+ export declare const NATIVE_MODULE_NAME = "RCTMGLVectorSource";
6
+ interface Props {
7
+ /**
8
+ * A string that uniquely identifies the source.
9
+ */
10
+ id: string;
11
+ /**
12
+ * A URL to a TileJSON configuration file describing the source’s contents and other metadata.
13
+ */
14
+ url?: string;
15
+ /**
16
+ * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.
17
+ * Example: https://example.com/vector-tiles/{z}/{x}/{y}.pbf
18
+ */
19
+ tileUrlTemplates?: string[];
20
+ /**
21
+ * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.
22
+ * The value should be between 0 and 22, inclusive, and less than
23
+ * maxZoomLevel, if specified. The default value for this option is 0.
24
+ */
25
+ minZoomLevel?: number;
26
+ /**
27
+ * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source.
28
+ * The value should be between 0 and 22, inclusive, and less than
29
+ * minZoomLevel, if specified. The default value for this option is 22.
30
+ */
31
+ maxZoomLevel?: number;
32
+ /**
33
+ * Influences the y direction of the tile coordinates. (tms inverts y axis)
34
+ */
35
+ tms?: boolean;
36
+ /**
37
+ * An HTML or literal text string defining the buttons to be displayed in an action sheet when the
38
+ * source is part of a map view’s style and the map view’s attribution button is pressed.
39
+ */
40
+ attribution?: string;
41
+ /**
42
+ * Source press listener, gets called when a user presses one of the children layers only
43
+ * if that layer has a higher z-index than another source layers
44
+ *
45
+ * @param {Object} event
46
+ * @param {Object[]} event.features - the geojson features that have hit by the press (might be multiple)
47
+ * @param {Object} event.coordinates - the coordinates of the click
48
+ * @param {Object} event.point - the point of the click
49
+ */
50
+ onPress?: (event: OnPressEvent) => void;
51
+ /**
52
+ * Overrides the default touch hitbox(44x44 pixels) for the source layers
53
+ */
54
+ hitbox?: {
55
+ /**
56
+ * `width` of hitbox
57
+ */
58
+ width: number;
59
+ /**
60
+ * `height` of hitbox
61
+ */
62
+ height: number;
63
+ };
64
+ children: React.ReactElement | React.ReactElement[];
65
+ }
66
+ declare type NativeProps = Props;
67
+ declare const VectorSource_base: {
68
+ new (...args: any[]): {
69
+ _nativeModuleName: string;
70
+ _onAndroidCallback: (e: any) => void;
71
+ _callbackMap: Map<string, any>;
72
+ _preRefMapMethodQueue: {
73
+ method: {
74
+ name: string; /**
75
+ * A string that uniquely identifies the source.
76
+ */
77
+ args: import("../utils").NativeArg[];
78
+ };
79
+ resolver: (value: import("../utils").NativeArg) => void;
80
+ }[];
81
+ _addAddAndroidCallback<ReturnType_1>(id: string, resolve: (value: ReturnType_1) => void, reject: (error: Error) => void): void;
82
+ _removeAndroidCallback(id: string): void;
83
+ _onAndroidCallbackO(e: React.SyntheticEvent<Element, import("./NativeBridgeComponent").RNMBEvent<{
84
+ [key: string]: string;
85
+ }>>): void;
86
+ _runPendingNativeCommands<RefType>(nativeRef: RefType): Promise<void>;
87
+ _runNativeCommand<RefType_1, ReturnType_2 = import("../utils").NativeArg>(methodName: string, nativeRef: RefType_1, args?: import("../utils").NativeArg[]): Promise<ReturnType_2>;
88
+ context: unknown;
89
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: object) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
90
+ forceUpdate(callback?: (() => void) | undefined): void;
91
+ render(): React.ReactNode;
92
+ readonly props: object;
93
+ state: Readonly<{}>;
94
+ refs: {
95
+ [key: string]: React.ReactInstance;
96
+ };
97
+ componentDidMount?(): void;
98
+ shouldComponentUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): boolean;
99
+ componentWillUnmount?(): void;
100
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
101
+ getSnapshotBeforeUpdate?(prevProps: object, prevState: Readonly<{}>): any;
102
+ componentDidUpdate?(prevProps: object, prevState: Readonly<{}>, snapshot?: any): void;
103
+ componentWillMount?(): void;
104
+ UNSAFE_componentWillMount?(): void;
105
+ componentWillReceiveProps?(nextProps: object, nextContext: any): void;
106
+ UNSAFE_componentWillReceiveProps?(nextProps: object, nextContext: any): void;
107
+ componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void;
108
+ UNSAFE_componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void;
109
+ };
110
+ } & {
111
+ new (props: (Props & import("../types/BaseProps").BaseProps) | Readonly<Props & import("../types/BaseProps").BaseProps>): AbstractSource<Props, Props>;
112
+ new (props: Props & import("../types/BaseProps").BaseProps, context: any): AbstractSource<Props, Props>;
113
+ contextType?: React.Context<any> | undefined;
114
+ };
115
+ /**
116
+ * VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map.
117
+ * The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification.
118
+ */
119
+ declare class VectorSource extends VectorSource_base {
120
+ static defaultProps: {
121
+ id: any;
122
+ };
123
+ constructor(props: Props);
124
+ _setNativeRef(nativeRef: (React.Component<NativeProps> & Readonly<NativeMethods>) | null): void;
125
+ /**
126
+ * Returns all features that match the query parameters regardless of whether or not the feature is
127
+ * currently rendered on the map. The domain of the query includes all currently-loaded vector tiles
128
+ * and GeoJSON source tiles. This function does not check tiles outside of the visible viewport.
129
+ *
130
+ * @example
131
+ * vectorSource.features(['id1', 'id2'])
132
+ *
133
+ * @param {Array=} layerIDs - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
134
+ * @param {Array=} filter - an optional filter statement to filter the returned Features.
135
+ * @return {FeatureCollection}
136
+ */
137
+ features(layerIDs?: never[], filter?: never[]): Promise<any>;
138
+ onPress(event: NativeSyntheticEvent<{
139
+ payload: OnPressEvent;
140
+ }>): void;
141
+ render(): JSX.Element;
142
+ }
143
+ export default VectorSource;
144
+ //# sourceMappingURL=VectorSource.d.ts.map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EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI;IAS5E;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,QAAQ,UAAK,EAAE,MAAM,UAAK;IAczC,OAAO,CACL,KAAK,EAAE,oBAAoB,CAAC;QAC1B,OAAO,EAAE,YAAY,CAAC;KACvB,CAAC;IAiCJ,MAAM;CAuBP;AAKD,eAAe,YAAY,CAAC"}
@@ -47,7 +47,7 @@ interface Coordinates {
47
47
  /**
48
48
  * LocationManager is a singleton, see `locationManager`
49
49
  */
50
- declare class LocationManager {
50
+ export declare class LocationManager {
51
51
  _listeners: ((location: Location) => void)[];
52
52
  _lastKnownLocation: Location | null;
53
53
  _isListening: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"locationManager.d.ts","sourceRoot":"","sources":["../../../../javascript/modules/location/locationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAKtB,eAAO,MAAM,0BAA0B,oBAEtC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,WAAW;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,cAAM,e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,4 @@
1
+ export declare type BaseProps = {
2
+ testID?: string | undefined;
3
+ };
4
+ //# sourceMappingURL=BaseProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseProps.d.ts","sourceRoot":"","sources":["../../../javascript/types/BaseProps.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare type OnPressEvent = {
2
+ features: Array<GeoJSON.Feature>;
3
+ coordinates: {
4
+ latitude: number;
5
+ longitude: number;
6
+ };
7
+ point: {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ };
12
+ //# sourceMappingURL=OnPressEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnPressEvent.d.ts","sourceRoot":"","sources":["../../../javascript/types/OnPressEvent.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { EmitterSubscription, NativeEventEmitter } from 'react-native';
2
+ declare type LogLevel = 'error' | 'warning' | 'info' | 'debug' | 'verbose';
3
+ export interface LogObject {
4
+ level: LogLevel;
5
+ message: string;
6
+ tag: string;
7
+ }
8
+ declare type LogCallback = (object: LogObject) => boolean;
9
+ declare class Logger {
10
+ static instance: Logger | null;
11
+ loggerEmitter: NativeEventEmitter;
12
+ startedCount: number;
13
+ logCallback?: LogCallback;
14
+ subscription?: EmitterSubscription;
15
+ static sharedInstance(): Logger;
16
+ constructor();
17
+ /**
18
+ * Set custom logger function.
19
+ * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then
20
+ * default logging will take place.
21
+ */
22
+ static setLogCallback(logCallback: LogCallback): void;
23
+ /**
24
+ * Set custom logger function.
25
+ * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then
26
+ * default logging will take place.
27
+ */
28
+ setLogCallback(logCallback: LogCallback): void;
29
+ /**
30
+ * This callback is displayed as part of the Requester class.
31
+ * @callback Logger~logCallback
32
+ * @param {object} log
33
+ * @param {string} log.message - the message of the log
34
+ * @param {string} log.level - log level
35
+ * @param {string} log.tag - optional tag used on android
36
+ */
37
+ /**
38
+ * setLogLevel
39
+ * @param {LogLevel} level
40
+ */
41
+ static setLogLevel(level: LogLevel): void;
42
+ /**
43
+ * @type {('error'|'warning'|'info'|'debug'|'verbose')} LogLevel - Supported log levels
44
+ */
45
+ start(): void;
46
+ stop(): void;
47
+ subscribe(): void;
48
+ unsubscribe(): void;
49
+ effectiveLevel(log: LogObject): LogLevel;
50
+ onLog(log: LogObject): void;
51
+ }
52
+ export default Logger;
53
+ //# sourceMappingURL=Logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../javascript/utils/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAGtB,aAAK,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,aAAK,WAAW,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC;AAElD,cAAM,MAAM;IACV,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEtC,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC,MAAM,CAAC,cAAc;;IAarB;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW;IAI9C;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW;IAIvC;;;;;;;OAOG;IAEH;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ;IAIlC;;OAEG;IACH,KAAK;IAOL,IAAI;IAOJ,SAAS;IAMT,WAAW;IAKX,cAAc,CAAC,GAAG,EAAE,SAAS;IAe7B,KAAK,CAAC,GAAG,EAAE,SAAS;CAarB;AAID,eAAe,MAAM,CAAC"}
@@ -3,10 +3,11 @@
3
3
  */
4
4
  export declare function deprecatedClass<C extends new (...args: any[]) => object>(origClass: C, deprecationMessage: string): C;
5
5
  /**
6
- * Copy properties from origObject to newObject, which not exists in newObject,
7
- * calls onDeprecatedCalled callback in case a copied property is invoked.
6
+ * Copy properties from origObject to newObject, but only those which not exists in newObject.
7
+ * Calls onDeprecatedCalled callback in case a copied property is invoked.
8
8
  */
9
- export declare function copyPropertiesAsDeprecated<DeprecatedType extends Record<string, unknown>, WithDeprecatedType extends Record<string, unknown>>(origObject: DeprecatedType, newObject: WithDeprecatedType, onDeprecatedCalled: (key: string) => void, accessors?: {
9
+ export declare function copyPropertiesAsDeprecated<DeprecatedType extends object, // Record<string, unknown>,
10
+ WithDeprecatedType extends Record<string, unknown>>(origObject: DeprecatedType, newObject: WithDeprecatedType, onDeprecatedCalled: (key: string) => void, accessors?: {
10
11
  [key: string]: (value: unknown) => unknown;
11
12
  }): WithDeprecatedType;
12
13
  //# sourceMappingURL=deprecation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../javascript/utils/deprecation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,EACtE,SAAS,EAAE,CAAC,EACZ,kBAAkB,EAAE,MAAM,GACzB,CAAC,CAQH;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9C,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAElD,UAAU,EAAE,cAAc,EAC1B,SAAS,EAAE,kBAAkB,EAC7B,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EACzC,SAAS,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAA;CAAO,GAC7D,kBAAkB,CAapB"}
1
+ {"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../javascript/utils/deprecation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,EACtE,SAAS,EAAE,CAAC,EACZ,kBAAkB,EAAE,MAAM,GACzB,CAAC,CAQH;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,SAAS,MAAM,EAAE,2BAA2B;AAC1D,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAElD,UAAU,EAAE,cAAc,EAC1B,SAAS,EAAE,kBAAkB,EAC7B,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EACzC,SAAS,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAA;CAAO,GAC7D,kBAAkB,CAapB"}
@@ -0,0 +1,21 @@
1
+ import { RefObject, type Component, type MutableRefObject } from 'react';
2
+ import { type NativeMethods, type HostComponent } from 'react-native';
3
+ /**
4
+ * Helper for useRef and requireNativeComponent:
5
+ * @example
6
+ * RCTMGLCamera = requireNativeComponent<NativeProps>('RCTMGLCamera');
7
+ * const ref = useRef<typeof RCTMGLCamera)(null) as NativeRefType<NativeProps>;
8
+ * ...
9
+ * <RCTMGLCamera ref={ref} ... />
10
+ */
11
+ export declare type NativeRefType<P> = MutableRefObject<(Component<P> & Readonly<NativeMethods>) | null>;
12
+ /**
13
+ * Helper for useRef and requireNativeComponent:
14
+ * @example
15
+ * RCTMGLCamera = requireNativeComponent<NativeProps>('RCTMGLCamera');
16
+ * const ref = nativeRef(useRef<typeof RCTMGLCamera)(null));
17
+ * ...
18
+ * <RCTMGLCamera ref={ref} ... />
19
+ */
20
+ export default function nativeRef<P>(c: RefObject<HostComponent<P> | null>): MutableRefObject<(Component<P> & Readonly<NativeMethods>) | null>;
21
+ //# sourceMappingURL=nativeRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeRef.d.ts","sourceRoot":"","sources":["../../../javascript/utils/nativeRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE;;;;;;;GAOG;AACH,oBAAY,aAAa,CAAC,CAAC,IAAI,gBAAgB,CAC7C,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAChD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EACjC,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GACpC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,CAEnE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rnmapbox/maps",
3
3
  "description": "A Mapbox react native module for creating custom maps",
4
- "version": "10.0.0-beta.73",
4
+ "version": "10.0.0-beta.74",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { requireNativeComponent } from 'react-native';
3
-
4
- import { viewPropTypes } from '../utils';
5
- import { LightLayerStyleProp } from '../utils/styleMap';
6
-
7
- import AbstractLayer from './AbstractLayer';
8
-
9
- export const NATIVE_MODULE_NAME = 'RCTMGLLight';
10
-
11
- /**
12
- * Light represents the light source for extruded geometries
13
- */
14
- class Light extends AbstractLayer {
15
- static propTypes = {
16
- ...viewPropTypes,
17
-
18
- /**
19
- * Customizable style attributes
20
- */
21
- style: LightLayerStyleProp,
22
- };
23
-
24
- setNativeProps(props) {
25
- if (this.refs.nativeLight) {
26
- this.refs.nativeLight.setNativeProps(props);
27
- }
28
- }
29
-
30
- render() {
31
- return (
32
- <RCTMGLLight
33
- ref="nativeLight"
34
- testID="rctmglLight"
35
- {...this.props}
36
- style={undefined}
37
- reactStyle={this.getStyle(this.props.style)}
38
- />
39
- );
40
- }
41
- }
42
-
43
- const RCTMGLLight = requireNativeComponent(NATIVE_MODULE_NAME, Light, {
44
- nativeOnly: { reactStyle: true },
45
- });
46
-
47
- export default Light;
@@ -1,203 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { NativeModules, requireNativeComponent } from 'react-native';
4
-
5
- import {
6
- cloneReactChildrenWithProps,
7
- viewPropTypes,
8
- isFunction,
9
- isAndroid,
10
- } from '../utils';
11
- import { getFilter } from '../utils/filterUtils';
12
- import { copyPropertiesAsDeprecated } from '../utils/deprecation';
13
-
14
- import AbstractSource from './AbstractSource';
15
- import NativeBridgeComponent from './NativeBridgeComponent';
16
-
17
- const MapboxGL = NativeModules.MGLModule;
18
-
19
- export const NATIVE_MODULE_NAME = 'RCTMGLVectorSource';
20
-
21
- /**
22
- * VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map.
23
- * The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification.
24
- */
25
- class VectorSource extends NativeBridgeComponent(
26
- AbstractSource,
27
- NATIVE_MODULE_NAME,
28
- ) {
29
- static propTypes = {
30
- ...viewPropTypes,
31
-
32
- /**
33
- * A string that uniquely identifies the source.
34
- */
35
- id: PropTypes.string.isRequired,
36
-
37
- /**
38
- * A URL to a TileJSON configuration file describing the source’s contents and other metadata.
39
- */
40
- url: PropTypes.string,
41
-
42
- /**
43
- * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.
44
- * Example: https://example.com/vector-tiles/{z}/{x}/{y}.pbf
45
- */
46
- tileUrlTemplates: PropTypes.arrayOf(PropTypes.string),
47
-
48
- /**
49
- * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.
50
- * The value should be between 0 and 22, inclusive, and less than
51
- * maxZoomLevel, if specified. The default value for this option is 0.
52
- */
53
- minZoomLevel: PropTypes.number,
54
-
55
- /**
56
- * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source.
57
- * The value should be between 0 and 22, inclusive, and less than
58
- * minZoomLevel, if specified. The default value for this option is 22.
59
- */
60
- maxZoomLevel: PropTypes.number,
61
-
62
- /**
63
- * Influences the y direction of the tile coordinates. (tms inverts y axis)
64
- */
65
- tms: PropTypes.bool,
66
-
67
- /**
68
- * An HTML or literal text string defining the buttons to be displayed in an action sheet when the
69
- * source is part of a map view’s style and the map view’s attribution button is pressed.
70
- */
71
- attribution: PropTypes.string,
72
-
73
- /**
74
- * Source press listener, gets called when a user presses one of the children layers only
75
- * if that layer has a higher z-index than another source layers
76
- *
77
- * @param {Object} event
78
- * @param {Object[]} event.features - the geojson features that have hit by the press (might be multiple)
79
- * @param {Object} event.coordinates - the coordinates of the click
80
- * @param {Object} event.point - the point of the click
81
- */
82
- onPress: PropTypes.func,
83
-
84
- /**
85
- * Overrides the default touch hitbox(44x44 pixels) for the source layers
86
- */
87
- hitbox: PropTypes.shape({
88
- /**
89
- * `width` of hitbox
90
- */
91
- width: PropTypes.number.isRequired,
92
- /**
93
- * `height` of hitbox
94
- */
95
- height: PropTypes.number.isRequired,
96
- }),
97
- };
98
-
99
- static defaultProps = {
100
- id: MapboxGL.StyleSource.DefaultSourceID,
101
- };
102
-
103
- constructor(props) {
104
- super(props);
105
- }
106
-
107
- _setNativeRef(nativeRef) {
108
- this._nativeRef = nativeRef;
109
- super._runPendingNativeCommands(nativeRef);
110
- }
111
-
112
- /**
113
- * Returns all features that match the query parameters regardless of whether or not the feature is
114
- * currently rendered on the map. The domain of the query includes all currently-loaded vector tiles
115
- * and GeoJSON source tiles. This function does not check tiles outside of the visible viewport.
116
- *
117
- * @example
118
- * vectorSource.features(['id1', 'id2'])
119
- *
120
- * @param {Array=} layerIDs - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
121
- * @param {Array=} filter - an optional filter statement to filter the returned Features.
122
- * @return {FeatureCollection}
123
- */
124
- async features(layerIDs = [], filter = []) {
125
- const res = await this._runNativeCommand('features', this._nativeRef, [
126
- layerIDs,
127
- getFilter(filter),
128
- ]);
129
-
130
- if (isAndroid()) {
131
- return JSON.parse(res.data);
132
- }
133
-
134
- return res.data;
135
- }
136
-
137
- onPress(event) {
138
- const {
139
- nativeEvent: {
140
- payload: { features, coordinates, point },
141
- },
142
- } = event;
143
- let newEvent = {
144
- features,
145
- coordinates,
146
- point,
147
- };
148
- newEvent = copyPropertiesAsDeprecated(
149
- event,
150
- newEvent,
151
- (key) => {
152
- console.warn(
153
- `event.${key} is deprecated on VectorSource#onPress, please use event.features`,
154
- );
155
- },
156
- {
157
- nativeEvent: (origNativeEvent) => ({
158
- ...origNativeEvent,
159
- payload: features[0],
160
- }),
161
- },
162
- );
163
- this.props.onPress(newEvent);
164
- }
165
-
166
- render() {
167
- const props = {
168
- id: this.props.id,
169
- url: this.props.url,
170
- tileUrlTemplates: this.props.tileUrlTemplates,
171
- minZoomLevel: this.props.minZoomLevel,
172
- maxZoomLevel: this.props.maxZoomLevel,
173
- tms: this.props.tms,
174
- attribution: this.props.attribution,
175
- hitbox: this.props.hitbox,
176
- hasPressListener: isFunction(this.props.onPress),
177
- onMapboxVectorSourcePress: this.onPress.bind(this),
178
- onPress: undefined,
179
- ref: (nativeRef) => this._setNativeRef(nativeRef),
180
- onAndroidCallback: isAndroid() ? this._onAndroidCallback : undefined,
181
- };
182
- return (
183
- <RCTMGLVectorSource ref={this.setNativeRef} {...props}>
184
- {cloneReactChildrenWithProps(this.props.children, {
185
- sourceID: this.props.id,
186
- })}
187
- </RCTMGLVectorSource>
188
- );
189
- }
190
- }
191
-
192
- const RCTMGLVectorSource = requireNativeComponent(
193
- NATIVE_MODULE_NAME,
194
- VectorSource,
195
- {
196
- nativeOnly: {
197
- hasPressListener: true,
198
- onMapboxVectorSourcePress: true,
199
- },
200
- },
201
- );
202
-
203
- export default VectorSource;