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

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 (196) hide show
  1. package/README.md +3 -3
  2. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/camera/CameraStop.kt +61 -46
  3. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/images/RCTMGLImagesManager.kt +5 -5
  4. package/ios/RCTMGL-v10/RCMTGLImage.swift +2 -1
  5. package/ios/RCTMGL-v10/RCTMGLImages.swift +57 -17
  6. package/ios/RCTMGL-v10/RCTMGLMapView.swift +11 -1
  7. package/ios/RCTMGL-v10/RCTMGLUtils.swift +14 -5
  8. package/javascript/MGLModule.ts +54 -0
  9. package/javascript/Mapbox.ts +97 -0
  10. package/javascript/classes/index.d.ts +20 -1
  11. package/javascript/components/Annotation.tsx +141 -0
  12. package/javascript/components/Callout.d.ts +35 -0
  13. package/javascript/components/ImageSource.tsx +81 -0
  14. package/javascript/components/Images.tsx +58 -6
  15. package/javascript/components/{MapView.js → MapView.tsx} +456 -383
  16. package/javascript/components/MarkerView.tsx +3 -2
  17. package/javascript/components/NativeBridgeComponent.tsx +1 -1
  18. package/javascript/components/PointAnnotation.tsx +4 -3
  19. package/javascript/components/RasterDemSource.tsx +105 -0
  20. package/javascript/components/RasterSource.tsx +124 -0
  21. package/javascript/components/ShapeSource.tsx +1 -1
  22. package/javascript/components/{Style.js → Style.tsx} +117 -35
  23. package/javascript/components/Terrain.tsx +8 -7
  24. package/javascript/components/{UserLocation.js → UserLocation.tsx} +105 -94
  25. package/javascript/components/VectorSource.tsx +1 -1
  26. package/javascript/index.ts +4 -0
  27. package/javascript/modules/offline/{OfflineCreatePackOptions.js → OfflineCreatePackOptions.ts} +21 -6
  28. package/javascript/modules/offline/{OfflinePack.js → OfflinePack.ts} +19 -4
  29. package/javascript/modules/offline/{offlineManager.js → offlineManager.ts} +81 -21
  30. package/javascript/modules/snapshot/{SnapshotOptions.js → SnapshotOptions.ts} +27 -3
  31. package/javascript/modules/snapshot/{snapshotManager.js → snapshotManager.ts} +2 -1
  32. package/javascript/types/Position.ts +1 -0
  33. package/javascript/utils/Logger.ts +1 -1
  34. package/javascript/utils/geoUtils.ts +56 -0
  35. package/javascript/utils/{index.js → index.ts} +41 -19
  36. package/lib/commonjs/MGLModule.js +37 -0
  37. package/lib/commonjs/MGLModule.js.map +1 -0
  38. package/lib/commonjs/Mapbox.js +372 -0
  39. package/lib/commonjs/Mapbox.js.map +1 -0
  40. package/lib/commonjs/classes/index.d.js +2 -0
  41. package/lib/commonjs/classes/index.d.js.map +1 -1
  42. package/lib/commonjs/components/{annotations/Annotation.js → Annotation.js} +26 -27
  43. package/lib/commonjs/components/Annotation.js.map +1 -0
  44. package/lib/commonjs/components/Callout.d.js +9 -0
  45. package/lib/commonjs/components/Callout.d.js.map +1 -0
  46. package/lib/commonjs/components/ImageSource.js +8 -25
  47. package/lib/commonjs/components/ImageSource.js.map +1 -1
  48. package/lib/commonjs/components/Images.js +17 -1
  49. package/lib/commonjs/components/Images.js.map +1 -1
  50. package/lib/commonjs/components/MapView.js +30 -289
  51. package/lib/commonjs/components/MapView.js.map +1 -1
  52. package/lib/commonjs/components/MarkerView.js.map +1 -1
  53. package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -1
  54. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  55. package/lib/commonjs/components/RasterDemSource.js +3 -37
  56. package/lib/commonjs/components/RasterDemSource.js.map +1 -1
  57. package/lib/commonjs/components/RasterSource.js +2 -46
  58. package/lib/commonjs/components/RasterSource.js.map +1 -1
  59. package/lib/commonjs/components/Style.js +11 -15
  60. package/lib/commonjs/components/Style.js.map +1 -1
  61. package/lib/commonjs/components/Terrain.js.map +1 -1
  62. package/lib/commonjs/components/UserLocation.js +26 -77
  63. package/lib/commonjs/components/UserLocation.js.map +1 -1
  64. package/lib/commonjs/index.js +16 -339
  65. package/lib/commonjs/index.js.map +1 -1
  66. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -4
  67. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  68. package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
  69. package/lib/commonjs/modules/offline/offlineManager.js +7 -2
  70. package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
  71. package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
  72. package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -1
  73. package/lib/commonjs/types/Position.js +2 -0
  74. package/lib/commonjs/{utils/index.d.js.map → types/Position.js.map} +1 -1
  75. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  76. package/lib/commonjs/utils/geoUtils.js +12 -38
  77. package/lib/commonjs/utils/geoUtils.js.map +1 -1
  78. package/lib/commonjs/utils/index.js +3 -6
  79. package/lib/commonjs/utils/index.js.map +1 -1
  80. package/lib/module/MGLModule.js +19 -0
  81. package/lib/module/MGLModule.js.map +1 -0
  82. package/lib/module/Mapbox.js +59 -0
  83. package/lib/module/Mapbox.js.map +1 -0
  84. package/lib/module/classes/index.d.js +2 -0
  85. package/lib/module/classes/index.d.js.map +1 -1
  86. package/lib/module/components/{annotations/Annotation.js → Annotation.js} +26 -27
  87. package/lib/module/components/Annotation.js.map +1 -0
  88. package/lib/module/components/Callout.d.js +2 -0
  89. package/lib/module/components/Callout.d.js.map +1 -0
  90. package/lib/module/components/ImageSource.js +8 -25
  91. package/lib/module/components/ImageSource.js.map +1 -1
  92. package/lib/module/components/Images.js +17 -1
  93. package/lib/module/components/Images.js.map +1 -1
  94. package/lib/module/components/MapView.js +31 -290
  95. package/lib/module/components/MapView.js.map +1 -1
  96. package/lib/module/components/MarkerView.js.map +1 -1
  97. package/lib/module/components/NativeBridgeComponent.js.map +1 -1
  98. package/lib/module/components/PointAnnotation.js.map +1 -1
  99. package/lib/module/components/RasterDemSource.js +4 -38
  100. package/lib/module/components/RasterDemSource.js.map +1 -1
  101. package/lib/module/components/RasterSource.js +3 -47
  102. package/lib/module/components/RasterSource.js.map +1 -1
  103. package/lib/module/components/Style.js +11 -15
  104. package/lib/module/components/Style.js.map +1 -1
  105. package/lib/module/components/Terrain.js.map +1 -1
  106. package/lib/module/components/UserLocation.js +25 -76
  107. package/lib/module/components/UserLocation.js.map +1 -1
  108. package/lib/module/index.js +3 -108
  109. package/lib/module/index.js.map +1 -1
  110. package/lib/module/modules/offline/OfflineCreatePackOptions.js +2 -4
  111. package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  112. package/lib/module/modules/offline/OfflinePack.js.map +1 -1
  113. package/lib/module/modules/offline/offlineManager.js +1 -1
  114. package/lib/module/modules/offline/offlineManager.js.map +1 -1
  115. package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
  116. package/lib/module/modules/snapshot/snapshotManager.js.map +1 -1
  117. package/lib/module/types/Position.js +2 -0
  118. package/lib/module/{utils/index.d.js.map → types/Position.js.map} +1 -1
  119. package/lib/module/utils/animated/Animated.js.map +1 -1
  120. package/lib/module/utils/geoUtils.js +5 -32
  121. package/lib/module/utils/geoUtils.js.map +1 -1
  122. package/lib/module/utils/index.js +3 -5
  123. package/lib/module/utils/index.js.map +1 -1
  124. package/lib/typescript/MGLModule.d.ts +22 -0
  125. package/lib/typescript/MGLModule.d.ts.map +1 -0
  126. package/lib/typescript/Mapbox.d.ts +54 -0
  127. package/lib/typescript/Mapbox.d.ts.map +1 -0
  128. package/lib/typescript/components/Annotation.d.ts +34 -0
  129. package/lib/typescript/components/Annotation.d.ts.map +1 -0
  130. package/lib/typescript/components/ImageSource.d.ts +32 -0
  131. package/lib/typescript/components/ImageSource.d.ts.map +1 -0
  132. package/lib/typescript/components/Images.d.ts +24 -2
  133. package/lib/typescript/components/Images.d.ts.map +1 -1
  134. package/lib/typescript/components/MapView.d.ts +469 -0
  135. package/lib/typescript/components/MapView.d.ts.map +1 -0
  136. package/lib/typescript/components/MarkerView.d.ts +3 -2
  137. package/lib/typescript/components/MarkerView.d.ts.map +1 -1
  138. package/lib/typescript/components/NativeBridgeComponent.d.ts +1 -1
  139. package/lib/typescript/components/NativeBridgeComponent.d.ts.map +1 -1
  140. package/lib/typescript/components/PointAnnotation.d.ts +10 -4
  141. package/lib/typescript/components/PointAnnotation.d.ts.map +1 -1
  142. package/lib/typescript/components/RasterDemSource.d.ts +46 -0
  143. package/lib/typescript/components/RasterDemSource.d.ts.map +1 -0
  144. package/lib/typescript/components/RasterSource.d.ts +59 -0
  145. package/lib/typescript/components/RasterSource.d.ts.map +1 -0
  146. package/lib/typescript/components/ShapeSource.d.ts +2 -2
  147. package/lib/typescript/components/ShapeSource.d.ts.map +1 -1
  148. package/lib/typescript/components/Style.d.ts +74 -0
  149. package/lib/typescript/components/Style.d.ts.map +1 -0
  150. package/lib/typescript/components/Terrain.d.ts +2 -2
  151. package/lib/typescript/components/Terrain.d.ts.map +1 -1
  152. package/lib/typescript/components/UserLocation.d.ts +102 -0
  153. package/lib/typescript/components/UserLocation.d.ts.map +1 -0
  154. package/lib/typescript/components/VectorSource.d.ts +2 -2
  155. package/lib/typescript/components/VectorSource.d.ts.map +1 -1
  156. package/lib/typescript/index.d.ts +4 -0
  157. package/lib/typescript/index.d.ts.map +1 -0
  158. package/lib/typescript/modules/offline/OfflineCreatePackOptions.d.ts +22 -0
  159. package/lib/typescript/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
  160. package/lib/typescript/modules/offline/OfflinePack.d.ts +24 -0
  161. package/lib/typescript/modules/offline/OfflinePack.d.ts.map +1 -0
  162. package/lib/typescript/modules/offline/offlineManager.d.ts +220 -0
  163. package/lib/typescript/modules/offline/offlineManager.d.ts.map +1 -0
  164. package/lib/typescript/modules/snapshot/SnapshotOptions.d.ts +41 -0
  165. package/lib/typescript/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
  166. package/lib/typescript/modules/snapshot/snapshotManager.d.ts +52 -0
  167. package/lib/typescript/modules/snapshot/snapshotManager.d.ts.map +1 -0
  168. package/lib/typescript/types/Position.d.ts +2 -0
  169. package/lib/typescript/types/Position.d.ts.map +1 -0
  170. package/lib/typescript/utils/Logger.d.ts +1 -1
  171. package/lib/typescript/utils/Logger.d.ts.map +1 -1
  172. package/lib/typescript/utils/animated/Animated.d.ts +23 -0
  173. package/lib/typescript/utils/animated/Animated.d.ts.map +1 -0
  174. package/lib/typescript/utils/geoUtils.d.ts +15 -0
  175. package/lib/typescript/utils/geoUtils.d.ts.map +1 -0
  176. package/lib/typescript/utils/index.d.ts +48 -0
  177. package/lib/typescript/utils/index.d.ts.map +1 -0
  178. package/package.json +4 -4
  179. package/index.d.ts +0 -745
  180. package/javascript/components/ImageSource.js +0 -82
  181. package/javascript/components/RasterDemSource.js +0 -106
  182. package/javascript/components/RasterSource.js +0 -124
  183. package/javascript/components/annotations/Annotation.js +0 -122
  184. package/javascript/index.js +0 -162
  185. package/javascript/utils/geoUtils.d.ts +0 -10
  186. package/javascript/utils/geoUtils.js +0 -73
  187. package/javascript/utils/index.d.ts +0 -27
  188. package/lib/commonjs/components/annotations/Annotation.js.map +0 -1
  189. package/lib/commonjs/utils/geoUtils.d.js +0 -2
  190. package/lib/commonjs/utils/geoUtils.d.js.map +0 -1
  191. package/lib/commonjs/utils/index.d.js +0 -2
  192. package/lib/module/components/annotations/Annotation.js.map +0 -1
  193. package/lib/module/utils/geoUtils.d.js +0 -2
  194. package/lib/module/utils/geoUtils.d.js.map +0 -1
  195. package/lib/module/utils/index.d.js +0 -2
  196. /package/javascript/utils/animated/{Animated.js → Animated.ts} +0 -0
@@ -5,8 +5,32 @@ import { makePoint, makeFeatureCollection } from '../../utils/geoUtils';
5
5
 
6
6
  const MapboxGL = NativeModules.MGLModule;
7
7
 
8
+ export type SnapshotOptionsArgs = {
9
+ centerCoordinate?: GeoJSON.Position;
10
+ width?: number;
11
+ height?: number;
12
+ zoomLevel?: number;
13
+ pitch?: number;
14
+ heading?: number;
15
+ styleURL?: string;
16
+ writeToDisk?: boolean;
17
+ bounds?: number[][];
18
+ withLogo?: boolean;
19
+ };
20
+
8
21
  class SnapshotOptions {
9
- constructor(options = {}) {
22
+ public readonly styleURL: string;
23
+ public readonly heading: number;
24
+ public readonly pitch: number;
25
+ public readonly zoomLevel: number;
26
+ public readonly width: number;
27
+ public readonly height: number;
28
+ public readonly writeToDisk: boolean;
29
+ public readonly withLogo: boolean;
30
+ public readonly centerCoordinate: string | undefined;
31
+ public readonly bounds: string | undefined;
32
+
33
+ constructor(options: SnapshotOptionsArgs = {}) {
10
34
  if (!options.centerCoordinate && !options.bounds) {
11
35
  throw new Error(
12
36
  'Center coordinate or bounds must be supplied in order to take a snapshot',
@@ -48,12 +72,12 @@ class SnapshotOptions {
48
72
  };
49
73
  }
50
74
 
51
- _createCenterCoordPoint(centerCoordinate) {
75
+ _createCenterCoordPoint(centerCoordinate: number[]) {
52
76
  const point = makePoint(centerCoordinate);
53
77
  return toJSONString(point);
54
78
  }
55
79
 
56
- _createBoundsCollection(bounds) {
80
+ _createBoundsCollection(bounds: number[][]) {
57
81
  const features = [];
58
82
 
59
83
  for (const bound of bounds) {
@@ -1,5 +1,6 @@
1
1
  import { NativeModules } from 'react-native';
2
2
 
3
+ export type { default as SnapshotOptions } from './SnapshotOptions';
3
4
  import SnapshotOptions from './SnapshotOptions';
4
5
 
5
6
  const MapboxGLSnapshotManger = NativeModules.MGLSnapshotModule;
@@ -50,7 +51,7 @@ class SnapshotManager {
50
51
  * @param {SnapshotOptions} options Snapshot options for create a static image of the base map
51
52
  * @return {Promise}
52
53
  */
53
- async takeSnap(options = {}) {
54
+ async takeSnap(options = {}): Promise<string> {
54
55
  const snapshotOptions = new SnapshotOptions(options);
55
56
 
56
57
  const uri = await MapboxGLSnapshotManger.takeSnap(snapshotOptions);
@@ -0,0 +1 @@
1
+ export type Position = [number, number] | number[];
@@ -5,7 +5,7 @@ import {
5
5
  } from 'react-native';
6
6
  const { MGLLogging } = NativeModules;
7
7
 
8
- type LogLevel = 'error' | 'warning' | 'info' | 'debug' | 'verbose';
8
+ export type LogLevel = 'error' | 'warning' | 'info' | 'debug' | 'verbose';
9
9
 
10
10
  export interface LogObject {
11
11
  level: LogLevel;
@@ -0,0 +1,56 @@
1
+ import {
2
+ featureCollection,
3
+ point,
4
+ feature,
5
+ lineString,
6
+ Position,
7
+ Properties,
8
+ Id,
9
+ BBox,
10
+ FeatureCollection,
11
+ Geometry,
12
+ Point,
13
+ Feature,
14
+ } from '@turf/helpers';
15
+ import distance from '@turf/distance';
16
+ import along from '@turf/along';
17
+
18
+ export const makePoint = point;
19
+
20
+ export const makeLineString = lineString;
21
+
22
+ export function makeLatLngBounds(
23
+ northEastCoordinates: Position,
24
+ southWestCoordinates: Position,
25
+ ): FeatureCollection<Point> {
26
+ return featureCollection([
27
+ point(northEastCoordinates),
28
+ point(southWestCoordinates),
29
+ ]);
30
+ }
31
+
32
+ export const makeFeature = feature;
33
+
34
+ export function makeFeatureCollection<G = Geometry, P = Properties>(
35
+ features: Array<Feature<G, P>> = [],
36
+ options?: {
37
+ bbox?: BBox;
38
+ id?: Id;
39
+ },
40
+ ) {
41
+ return featureCollection(features, options);
42
+ }
43
+
44
+ export function addToFeatureCollection(
45
+ newFeatureCollection: FeatureCollection,
46
+ newFeature: Feature,
47
+ ): FeatureCollection {
48
+ return {
49
+ ...newFeatureCollection,
50
+ features: [...newFeatureCollection.features, newFeature],
51
+ };
52
+ }
53
+
54
+ export const calculateDistance = distance;
55
+
56
+ export const pointAlongLine = along;
@@ -1,15 +1,15 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import React from 'react';
2
3
  import {
3
- View,
4
4
  NativeModules,
5
5
  findNodeHandle,
6
6
  Platform,
7
7
  Image,
8
+ ImageSourcePropType,
8
9
  } from 'react-native';
9
- import { ViewPropTypes } from 'deprecated-react-native-prop-types';
10
10
  import PropTypes from 'prop-types';
11
11
 
12
- function getAndroidManagerInstance(module) {
12
+ function getAndroidManagerInstance(module: string) {
13
13
  const haveViewManagerConfig =
14
14
  NativeModules.UIManager && NativeModules.UIManager.getViewManagerConfig;
15
15
  return haveViewManagerConfig
@@ -17,12 +17,10 @@ function getAndroidManagerInstance(module) {
17
17
  : NativeModules.UIManager[module];
18
18
  }
19
19
 
20
- function getIosManagerInstance(module) {
20
+ function getIosManagerInstance(module: string): any {
21
21
  return NativeModules[getIOSModuleName(module)];
22
22
  }
23
23
 
24
- export const viewPropTypes = ViewPropTypes || View.props;
25
-
26
24
  export const ornamentPositionPropType = PropTypes.oneOfType([
27
25
  PropTypes.shape({ top: PropTypes.number, left: PropTypes.number }),
28
26
  PropTypes.shape({ top: PropTypes.number, right: PropTypes.number }),
@@ -30,42 +28,57 @@ export const ornamentPositionPropType = PropTypes.oneOfType([
30
28
  PropTypes.shape({ bottom: PropTypes.number, right: PropTypes.number }),
31
29
  ]);
32
30
 
33
- export function isAndroid() {
31
+ export function isAndroid(): boolean {
34
32
  return Platform.OS === 'android';
35
33
  }
36
34
 
37
- export function existenceChange(cur, next) {
35
+ export function existenceChange(cur: boolean, next: boolean): boolean {
38
36
  if (!cur && !next) {
39
37
  return false;
40
38
  }
41
39
  return (!cur && next) || (cur && !next);
42
40
  }
43
41
 
44
- export function isFunction(fn) {
42
+ export function isFunction(fn: unknown): fn is boolean {
45
43
  return typeof fn === 'function';
46
44
  }
47
45
 
48
- export function isNumber(num) {
46
+ export function isNumber(num: unknown): num is number {
49
47
  return typeof num === 'number' && !Number.isNaN(num);
50
48
  }
51
49
 
52
- export function isUndefined(obj) {
50
+ export function isUndefined(obj: unknown): obj is undefined {
53
51
  return typeof obj === 'undefined';
54
52
  }
55
53
 
56
- export function isString(str) {
54
+ export function isString(str: unknown): str is string {
57
55
  return typeof str === 'string';
58
56
  }
59
57
 
60
- export function isBoolean(bool) {
58
+ export function isBoolean(bool: unknown): bool is boolean {
61
59
  return typeof bool === 'boolean';
62
60
  }
63
61
 
64
- export function isPrimitive(value) {
62
+ export function isPrimitive(
63
+ value: unknown,
64
+ ): value is string | number | boolean {
65
65
  return isString(value) || isNumber(value) || isBoolean(value);
66
66
  }
67
67
 
68
- export function runNativeCommand(module, name, nativeRef, args = []) {
68
+ export type NativeArg =
69
+ | string
70
+ | number
71
+ | boolean
72
+ | null
73
+ | { [k: string]: NativeArg }
74
+ | NativeArg[];
75
+
76
+ export function runNativeCommand<ReturnType = NativeArg>(
77
+ module: string,
78
+ name: string,
79
+ nativeRef: any,
80
+ args: NativeArg[],
81
+ ): Promise<ReturnType> {
69
82
  const handle = findNodeHandle(nativeRef);
70
83
  if (!handle) {
71
84
  throw new Error(`Could not find handle for native ref ${module}.${name}`);
@@ -93,7 +106,10 @@ export function runNativeCommand(module, name, nativeRef, args = []) {
93
106
  return managerInstance[name](handle, ...args);
94
107
  }
95
108
 
96
- export function cloneReactChildrenWithProps(children, propsToAdd = {}) {
109
+ export function cloneReactChildrenWithProps(
110
+ children: Parameters<typeof React.Children.map>[0],
111
+ propsToAdd: { [key: string]: string } = {},
112
+ ) {
97
113
  if (!children) {
98
114
  return null;
99
115
  }
@@ -112,18 +128,24 @@ export function cloneReactChildrenWithProps(children, propsToAdd = {}) {
112
128
  );
113
129
  }
114
130
 
115
- export function resolveImagePath(imageRef) {
131
+ export function resolveImagePath(imageRef: ImageSourcePropType): string {
116
132
  const res = Image.resolveAssetSource(imageRef);
117
133
  return res.uri;
118
134
  }
119
135
 
120
- export function getIOSModuleName(moduleName) {
136
+ export function getIOSModuleName(moduleName: string): string {
121
137
  if (moduleName.startsWith('RCT')) {
122
138
  return moduleName.substring(3);
123
139
  }
124
140
  return moduleName;
125
141
  }
126
142
 
127
- export function toJSONString(json = '') {
143
+ export function toJSONString(json: any = '') {
128
144
  return JSON.stringify(json);
129
145
  }
146
+
147
+ export type OrnamentPositonProp =
148
+ | { top: number; left: number }
149
+ | { top: number; right: number }
150
+ | { bottom: number; left: number }
151
+ | { bottom: number; right: number };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setWellKnownTileServer = exports.setTelemetryEnabled = exports.setConnected = exports.setAccessToken = exports.removeCustomHeader = exports.getAccessToken = exports.addCustomHeader = exports.TileServers = exports.StyleURL = exports.StyleSource = exports.OfflinePackDownloadState = exports.LineJoin = void 0;
7
+ var _reactNative = require("react-native");
8
+ const MGLModule = {
9
+ ..._reactNative.NativeModules.MGLModule
10
+ };
11
+ const {
12
+ StyleURL,
13
+ OfflinePackDownloadState,
14
+ LineJoin,
15
+ StyleSource,
16
+ TileServers,
17
+ removeCustomHeader,
18
+ addCustomHeader,
19
+ setAccessToken,
20
+ setWellKnownTileServer,
21
+ getAccessToken,
22
+ setTelemetryEnabled,
23
+ setConnected
24
+ } = MGLModule;
25
+ exports.setConnected = setConnected;
26
+ exports.setTelemetryEnabled = setTelemetryEnabled;
27
+ exports.getAccessToken = getAccessToken;
28
+ exports.setWellKnownTileServer = setWellKnownTileServer;
29
+ exports.setAccessToken = setAccessToken;
30
+ exports.addCustomHeader = addCustomHeader;
31
+ exports.removeCustomHeader = removeCustomHeader;
32
+ exports.TileServers = TileServers;
33
+ exports.StyleSource = StyleSource;
34
+ exports.LineJoin = LineJoin;
35
+ exports.OfflinePackDownloadState = OfflinePackDownloadState;
36
+ exports.StyleURL = StyleURL;
37
+ //# sourceMappingURL=MGLModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","MGLModule","NativeModules","StyleURL","OfflinePackDownloadState","LineJoin","StyleSource","TileServers","removeCustomHeader","addCustomHeader","setAccessToken","setWellKnownTileServer","getAccessToken","setTelemetryEnabled","setConnected","exports"],"sourceRoot":"../../javascript","sources":["MGLModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAsCA,MAAMC,SAAoB,GAAG;EAAE,GAAGC,0BAAa,CAACD;AAAU,CAAC;AAEpD,MAAM;EACXE,QAAQ;EACRC,wBAAwB;EACxBC,QAAQ;EACRC,WAAW;EACXC,WAAW;EACXC,kBAAkB;EAClBC,eAAe;EACfC,cAAc;EACdC,sBAAsB;EACtBC,cAAc;EACdC,mBAAmB;EACnBC;AACF,CAAC,GAAGb,SAAS;AAACc,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAAAC,OAAA,CAAAF,mBAAA,GAAAA,mBAAA;AAAAE,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAAAG,OAAA,CAAAJ,sBAAA,GAAAA,sBAAA;AAAAI,OAAA,CAAAL,cAAA,GAAAA,cAAA;AAAAK,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAAAM,OAAA,CAAAP,kBAAA,GAAAA,kBAAA;AAAAO,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAAAQ,OAAA,CAAAT,WAAA,GAAAA,WAAA;AAAAS,OAAA,CAAAV,QAAA,GAAAA,QAAA;AAAAU,OAAA,CAAAX,wBAAA,GAAAA,wBAAA;AAAAW,OAAA,CAAAZ,QAAA,GAAAA,QAAA"}
@@ -0,0 +1,372 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ AnimatedMapPoint: true,
8
+ StyleURL: true,
9
+ UserTrackingModes: true,
10
+ Camera: true,
11
+ UserTrackingMode: true,
12
+ Atmosphere: true,
13
+ MapView: true,
14
+ Light: true,
15
+ PointAnnotation: true,
16
+ Annotation: true,
17
+ Callout: true,
18
+ UserLocation: true,
19
+ VectorSource: true,
20
+ ShapeSource: true,
21
+ RasterSource: true,
22
+ RasterDemSource: true,
23
+ ImageSource: true,
24
+ Images: true,
25
+ Image: true,
26
+ FillLayer: true,
27
+ FillExtrusionLayer: true,
28
+ HeatmapLayer: true,
29
+ LineLayer: true,
30
+ CircleLayer: true,
31
+ SkyLayer: true,
32
+ SymbolLayer: true,
33
+ RasterLayer: true,
34
+ BackgroundLayer: true,
35
+ Terrain: true,
36
+ locationManager: true,
37
+ offlineManager: true,
38
+ OfflineCreatePackOptions: true,
39
+ snapshotManager: true,
40
+ MarkerView: true,
41
+ Animated: true,
42
+ AnimatedCoordinatesArray: true,
43
+ AnimatedExtractCoordinateFromArray: true,
44
+ AnimatedPoint: true,
45
+ AnimatedRouteCoordinatesArray: true,
46
+ AnimatedShape: true,
47
+ Style: true,
48
+ Logger: true,
49
+ requestAndroidLocationPermissions: true,
50
+ getAnnotationsLayerID: true
51
+ };
52
+ Object.defineProperty(exports, "Animated", {
53
+ enumerable: true,
54
+ get: function () {
55
+ return _Animated.default;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, "AnimatedCoordinatesArray", {
59
+ enumerable: true,
60
+ get: function () {
61
+ return _classes.AnimatedCoordinatesArray;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, "AnimatedExtractCoordinateFromArray", {
65
+ enumerable: true,
66
+ get: function () {
67
+ return _classes.AnimatedExtractCoordinateFromArray;
68
+ }
69
+ });
70
+ exports.AnimatedMapPoint = void 0;
71
+ Object.defineProperty(exports, "AnimatedPoint", {
72
+ enumerable: true,
73
+ get: function () {
74
+ return _classes.AnimatedPoint;
75
+ }
76
+ });
77
+ Object.defineProperty(exports, "AnimatedRouteCoordinatesArray", {
78
+ enumerable: true,
79
+ get: function () {
80
+ return _classes.AnimatedRouteCoordinatesArray;
81
+ }
82
+ });
83
+ Object.defineProperty(exports, "AnimatedShape", {
84
+ enumerable: true,
85
+ get: function () {
86
+ return _classes.AnimatedShape;
87
+ }
88
+ });
89
+ Object.defineProperty(exports, "Annotation", {
90
+ enumerable: true,
91
+ get: function () {
92
+ return _Annotation.default;
93
+ }
94
+ });
95
+ Object.defineProperty(exports, "Atmosphere", {
96
+ enumerable: true,
97
+ get: function () {
98
+ return _Atmosphere.Atmosphere;
99
+ }
100
+ });
101
+ Object.defineProperty(exports, "BackgroundLayer", {
102
+ enumerable: true,
103
+ get: function () {
104
+ return _BackgroundLayer.default;
105
+ }
106
+ });
107
+ Object.defineProperty(exports, "Callout", {
108
+ enumerable: true,
109
+ get: function () {
110
+ return _Callout.default;
111
+ }
112
+ });
113
+ Object.defineProperty(exports, "Camera", {
114
+ enumerable: true,
115
+ get: function () {
116
+ return _Camera.Camera;
117
+ }
118
+ });
119
+ Object.defineProperty(exports, "CircleLayer", {
120
+ enumerable: true,
121
+ get: function () {
122
+ return _CircleLayer.default;
123
+ }
124
+ });
125
+ Object.defineProperty(exports, "FillExtrusionLayer", {
126
+ enumerable: true,
127
+ get: function () {
128
+ return _FillExtrusionLayer.default;
129
+ }
130
+ });
131
+ Object.defineProperty(exports, "FillLayer", {
132
+ enumerable: true,
133
+ get: function () {
134
+ return _FillLayer.default;
135
+ }
136
+ });
137
+ Object.defineProperty(exports, "HeatmapLayer", {
138
+ enumerable: true,
139
+ get: function () {
140
+ return _HeatmapLayer.default;
141
+ }
142
+ });
143
+ Object.defineProperty(exports, "Image", {
144
+ enumerable: true,
145
+ get: function () {
146
+ return _Image.default;
147
+ }
148
+ });
149
+ Object.defineProperty(exports, "ImageSource", {
150
+ enumerable: true,
151
+ get: function () {
152
+ return _ImageSource.default;
153
+ }
154
+ });
155
+ Object.defineProperty(exports, "Images", {
156
+ enumerable: true,
157
+ get: function () {
158
+ return _Images.default;
159
+ }
160
+ });
161
+ Object.defineProperty(exports, "Light", {
162
+ enumerable: true,
163
+ get: function () {
164
+ return _Light.default;
165
+ }
166
+ });
167
+ Object.defineProperty(exports, "LineLayer", {
168
+ enumerable: true,
169
+ get: function () {
170
+ return _LineLayer.default;
171
+ }
172
+ });
173
+ Object.defineProperty(exports, "Logger", {
174
+ enumerable: true,
175
+ get: function () {
176
+ return _Logger.default;
177
+ }
178
+ });
179
+ Object.defineProperty(exports, "MapView", {
180
+ enumerable: true,
181
+ get: function () {
182
+ return _MapView.default;
183
+ }
184
+ });
185
+ Object.defineProperty(exports, "MarkerView", {
186
+ enumerable: true,
187
+ get: function () {
188
+ return _MarkerView.default;
189
+ }
190
+ });
191
+ Object.defineProperty(exports, "OfflineCreatePackOptions", {
192
+ enumerable: true,
193
+ get: function () {
194
+ return _offlineManager.OfflineCreatePackOptions;
195
+ }
196
+ });
197
+ Object.defineProperty(exports, "PointAnnotation", {
198
+ enumerable: true,
199
+ get: function () {
200
+ return _PointAnnotation.default;
201
+ }
202
+ });
203
+ Object.defineProperty(exports, "RasterDemSource", {
204
+ enumerable: true,
205
+ get: function () {
206
+ return _RasterDemSource.default;
207
+ }
208
+ });
209
+ Object.defineProperty(exports, "RasterLayer", {
210
+ enumerable: true,
211
+ get: function () {
212
+ return _RasterLayer.default;
213
+ }
214
+ });
215
+ Object.defineProperty(exports, "RasterSource", {
216
+ enumerable: true,
217
+ get: function () {
218
+ return _RasterSource.default;
219
+ }
220
+ });
221
+ Object.defineProperty(exports, "ShapeSource", {
222
+ enumerable: true,
223
+ get: function () {
224
+ return _ShapeSource.ShapeSource;
225
+ }
226
+ });
227
+ Object.defineProperty(exports, "SkyLayer", {
228
+ enumerable: true,
229
+ get: function () {
230
+ return _SkyLayer.default;
231
+ }
232
+ });
233
+ Object.defineProperty(exports, "Style", {
234
+ enumerable: true,
235
+ get: function () {
236
+ return _Style.default;
237
+ }
238
+ });
239
+ exports.StyleURL = void 0;
240
+ Object.defineProperty(exports, "SymbolLayer", {
241
+ enumerable: true,
242
+ get: function () {
243
+ return _SymbolLayer.SymbolLayer;
244
+ }
245
+ });
246
+ Object.defineProperty(exports, "Terrain", {
247
+ enumerable: true,
248
+ get: function () {
249
+ return _Terrain.Terrain;
250
+ }
251
+ });
252
+ Object.defineProperty(exports, "UserLocation", {
253
+ enumerable: true,
254
+ get: function () {
255
+ return _UserLocation.default;
256
+ }
257
+ });
258
+ Object.defineProperty(exports, "UserTrackingMode", {
259
+ enumerable: true,
260
+ get: function () {
261
+ return _Camera.UserTrackingMode;
262
+ }
263
+ });
264
+ exports.UserTrackingModes = void 0;
265
+ Object.defineProperty(exports, "VectorSource", {
266
+ enumerable: true,
267
+ get: function () {
268
+ return _VectorSource.default;
269
+ }
270
+ });
271
+ Object.defineProperty(exports, "getAnnotationsLayerID", {
272
+ enumerable: true,
273
+ get: function () {
274
+ return _getAnnotationsLayerID.getAnnotationsLayerID;
275
+ }
276
+ });
277
+ Object.defineProperty(exports, "locationManager", {
278
+ enumerable: true,
279
+ get: function () {
280
+ return _locationManager.default;
281
+ }
282
+ });
283
+ Object.defineProperty(exports, "offlineManager", {
284
+ enumerable: true,
285
+ get: function () {
286
+ return _offlineManager.default;
287
+ }
288
+ });
289
+ Object.defineProperty(exports, "requestAndroidLocationPermissions", {
290
+ enumerable: true,
291
+ get: function () {
292
+ return _requestAndroidLocationPermissions.requestAndroidLocationPermissions;
293
+ }
294
+ });
295
+ Object.defineProperty(exports, "snapshotManager", {
296
+ enumerable: true,
297
+ get: function () {
298
+ return _snapshotManager.default;
299
+ }
300
+ });
301
+ var _MGLModule = require("./MGLModule");
302
+ Object.keys(_MGLModule).forEach(function (key) {
303
+ if (key === "default" || key === "__esModule") return;
304
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
305
+ if (key in exports && exports[key] === _MGLModule[key]) return;
306
+ Object.defineProperty(exports, key, {
307
+ enumerable: true,
308
+ get: function () {
309
+ return _MGLModule[key];
310
+ }
311
+ });
312
+ });
313
+ var _Camera = require("./components/Camera");
314
+ var _Atmosphere = require("./components/Atmosphere");
315
+ var _MapView = _interopRequireDefault(require("./components/MapView"));
316
+ var _Light = _interopRequireDefault(require("./components/Light"));
317
+ var _PointAnnotation = _interopRequireDefault(require("./components/PointAnnotation"));
318
+ var _Annotation = _interopRequireDefault(require("./components/Annotation"));
319
+ var _Callout = _interopRequireDefault(require("./components/Callout"));
320
+ var _UserLocation = _interopRequireDefault(require("./components/UserLocation"));
321
+ var _VectorSource = _interopRequireDefault(require("./components/VectorSource"));
322
+ var _ShapeSource = require("./components/ShapeSource");
323
+ var _RasterSource = _interopRequireDefault(require("./components/RasterSource"));
324
+ var _RasterDemSource = _interopRequireDefault(require("./components/RasterDemSource"));
325
+ var _ImageSource = _interopRequireDefault(require("./components/ImageSource"));
326
+ var _Images = _interopRequireDefault(require("./components/Images"));
327
+ var _Image = _interopRequireDefault(require("./components/Image"));
328
+ var _FillLayer = _interopRequireDefault(require("./components/FillLayer"));
329
+ var _FillExtrusionLayer = _interopRequireDefault(require("./components/FillExtrusionLayer"));
330
+ var _HeatmapLayer = _interopRequireDefault(require("./components/HeatmapLayer"));
331
+ var _LineLayer = _interopRequireDefault(require("./components/LineLayer"));
332
+ var _CircleLayer = _interopRequireDefault(require("./components/CircleLayer"));
333
+ var _SkyLayer = _interopRequireDefault(require("./components/SkyLayer"));
334
+ var _SymbolLayer = require("./components/SymbolLayer");
335
+ var _RasterLayer = _interopRequireDefault(require("./components/RasterLayer"));
336
+ var _BackgroundLayer = _interopRequireDefault(require("./components/BackgroundLayer"));
337
+ var _Terrain = require("./components/Terrain");
338
+ var _locationManager = _interopRequireDefault(require("./modules/location/locationManager"));
339
+ var _offlineManager = _interopRequireWildcard(require("./modules/offline/offlineManager"));
340
+ var _snapshotManager = _interopRequireDefault(require("./modules/snapshot/snapshotManager"));
341
+ var _MarkerView = _interopRequireDefault(require("./components/MarkerView"));
342
+ var _Animated = _interopRequireDefault(require("./utils/animated/Animated"));
343
+ var _classes = require("./classes");
344
+ var _Style = _interopRequireDefault(require("./components/Style"));
345
+ var _Logger = _interopRequireDefault(require("./utils/Logger"));
346
+ var _requestAndroidLocationPermissions = require("./requestAndroidLocationPermissions");
347
+ var _getAnnotationsLayerID = require("./utils/getAnnotationsLayerID");
348
+ var _deprecation = require("./utils/deprecation");
349
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
350
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
351
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
352
+ /** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */
353
+ const AnimatedMapPoint = (0, _deprecation.deprecatedClass)(_classes.AnimatedPoint, 'AnimatedMapPoint is deprecated please use AnimatedPoint');
354
+
355
+ // types:
356
+ exports.AnimatedMapPoint = AnimatedMapPoint;
357
+ let StyleURL;
358
+ /** @deprecated UserTrackingModes is deprecated use UserTrackingMode */
359
+ exports.StyleURL = StyleURL;
360
+ (function (StyleURL) {
361
+ StyleURL["Street"] = "mapbox://styles/mapbox/streets-v11";
362
+ StyleURL["Dark"] = "mapbox://styles/mapbox/dark-v10";
363
+ StyleURL["Light"] = "mapbox://styles/mapbox/light-v10";
364
+ StyleURL["Outdoors"] = "mapbox://styles/mapbox/outdoors-v11";
365
+ StyleURL["Satellite"] = "mapbox://styles/mapbox/satellite-v9";
366
+ StyleURL["SatelliteStreet"] = "mapbox://styles/mapbox/satellite-streets-v11";
367
+ StyleURL["TrafficDay"] = "mapbox://styles/mapbox/navigation-preview-day-v4";
368
+ StyleURL["TrafficNight"] = "mapbox://styles/mapbox/navigation-preview-night-v4";
369
+ })(StyleURL || (exports.StyleURL = StyleURL = {}));
370
+ const UserTrackingModes = _Camera.UserTrackingMode;
371
+ exports.UserTrackingModes = UserTrackingModes;
372
+ //# sourceMappingURL=Mapbox.js.map