@rnmapbox/maps 10.2.7 → 10.2.8
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.
- package/android/build.gradle +9 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +8 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +7 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt +180 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt +4 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXModule.kt +2 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXOfflineModuleLegacy.kt +10 -0
- package/android/src/main/mapbox-v11-compat/v10/com/mapbox/maps/extension/style/layers/generated/RasterParticleLayer.kt +58 -0
- package/android/src/main/mapbox-v11-compat/v10/com/mapbox/maps/extension/style/sources/generated/RasterArraySource.kt +20 -0
- package/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/components/styles/layers/RNMBXRasterParticleLayer.kt +22 -0
- package/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/components/styles/layers/RNMBXRasterParticleLayerManager.kt +59 -0
- package/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterArraySource.kt +16 -0
- package/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterArraySourceManager.kt +59 -0
- package/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt +45 -0
- package/android/src/main/mapbox-v11-compat/v11/com/rnmapbox/rnmbx/components/styles/layers/RNMBXRasterParticleLayer.kt +38 -0
- package/android/src/main/mapbox-v11-compat/v11/com/rnmapbox/rnmbx/components/styles/layers/RNMBXRasterParticleLayerManager.kt +85 -0
- package/android/src/main/mapbox-v11-compat/v11/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterArraySource.kt +41 -0
- package/android/src/main/mapbox-v11-compat/v11/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterArraySourceManager.kt +76 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterArraySourceManagerDelegate.java +54 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterArraySourceManagerInterface.java +23 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterParticleLayerManagerDelegate.java +66 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterParticleLayerManagerInterface.java +27 -0
- package/ios/RNMBX/Offline/RNMBXOfflineModuleLegacy.m +2 -0
- package/ios/RNMBX/Offline/RNMBXOfflineModuleLegacy.swift +5 -0
- package/ios/RNMBX/RNMBXCamera.swift +88 -17
- package/ios/RNMBX/RNMBXCameraModule.h +3 -2
- package/ios/RNMBX/RNMBXCameraModule.mm +8 -16
- package/ios/RNMBX/RNMBXCustomLocationProvider.swift +18 -24
- package/ios/RNMBX/RNMBXImageModule.h +3 -2
- package/ios/RNMBX/RNMBXImageModule.mm +8 -16
- package/ios/RNMBX/RNMBXImages.swift +1 -4
- package/ios/RNMBX/RNMBXInteractiveElement.swift +22 -15
- package/ios/RNMBX/RNMBXMapView.swift +68 -6
- package/ios/RNMBX/RNMBXNativeUserLocation.swift +6 -6
- package/ios/RNMBX/RNMBXPointAnnotation.swift +6 -8
- package/ios/RNMBX/RNMBXPointAnnotationModule.h +3 -2
- package/ios/RNMBX/RNMBXPointAnnotationModule.mm +8 -16
- package/ios/RNMBX/RNMBXRasterArraySource.swift +47 -0
- package/ios/RNMBX/RNMBXRasterArraySourceComponentView.h +15 -0
- package/ios/RNMBX/RNMBXRasterArraySourceComponentView.mm +168 -0
- package/ios/RNMBX/RNMBXRasterArraySourceViewManager.swift +16 -0
- package/ios/RNMBX/RNMBXRasterParticleLayer.swift +100 -0
- package/ios/RNMBX/RNMBXRasterParticleLayerComponentView.h +15 -0
- package/ios/RNMBX/RNMBXRasterParticleLayerComponentView.mm +121 -0
- package/ios/RNMBX/RNMBXRasterParticleLayerViewManager.swift +17 -0
- package/ios/RNMBX/RNMBXShapeSource.swift +5 -4
- package/ios/RNMBX/RNMBXShapeSourceModule.h +3 -2
- package/ios/RNMBX/RNMBXShapeSourceModule.mm +8 -16
- package/ios/RNMBX/RNMBXSource.swift +51 -21
- package/ios/RNMBX/RNMBXStyle.swift +152 -27
- package/ios/RNMBX/RNMBXStyleValue.swift +27 -0
- package/ios/RNMBX/RNMBXViewport.swift +13 -13
- package/ios/RNMBX/RNMBXViewportModule.h +3 -2
- package/ios/RNMBX/RNMBXViewportModule.mm +8 -16
- package/lib/commonjs/plugin/build/withMapbox.js +1 -1
- package/lib/commonjs/plugin/src/withMapbox.ts +13 -3
- package/lib/module/Mapbox.native.js +2 -0
- package/lib/module/Mapbox.native.js.map +1 -1
- package/lib/module/RNMBXModule.js.map +1 -1
- package/lib/module/components/PointAnnotation.js.map +1 -1
- package/lib/module/components/RasterArraySource.js +67 -0
- package/lib/module/components/RasterArraySource.js.map +1 -0
- package/lib/module/components/RasterParticleLayer.js +40 -0
- package/lib/module/components/RasterParticleLayer.js.map +1 -0
- package/lib/module/modules/offline/offlineManagerLegacy.js +14 -0
- package/lib/module/modules/offline/offlineManagerLegacy.js.map +1 -1
- package/lib/module/specs/RNMBXRasterArraySourceNativeComponent.ts +22 -0
- package/lib/module/specs/RNMBXRasterParticleLayerNativeComponent.ts +39 -0
- package/lib/module/utils/MapboxStyles.js.map +1 -1
- package/lib/module/utils/styleMap.js +9 -0
- package/lib/module/utils/styleMap.js.map +1 -1
- package/lib/typescript/plugin/src/withMapbox.d.ts.map +1 -1
- package/lib/typescript/scripts/autogenHelpers/generateCodeWithEjs.d.mts.map +1 -1
- package/lib/typescript/scripts/autogenHelpers/globals.d.mts +1 -1
- package/lib/typescript/scripts/autogenHelpers/globals.d.mts.map +1 -1
- package/lib/typescript/src/Mapbox.native.d.ts +3 -1
- package/lib/typescript/src/Mapbox.native.d.ts.map +1 -1
- package/lib/typescript/src/RNMBXModule.d.ts.map +1 -1
- package/lib/typescript/src/components/PointAnnotation.d.ts +1 -1
- package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/src/components/RasterArraySource.d.ts +72 -0
- package/lib/typescript/src/components/RasterArraySource.d.ts.map +1 -0
- package/lib/typescript/src/components/RasterParticleLayer.d.ts +80 -0
- package/lib/typescript/src/components/RasterParticleLayer.d.ts.map +1 -0
- package/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts +11 -0
- package/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts.map +1 -1
- package/lib/typescript/src/specs/RNMBXRasterArraySourceNativeComponent.d.ts +16 -0
- package/lib/typescript/src/specs/RNMBXRasterArraySourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXRasterParticleLayerNativeComponent.d.ts +25 -0
- package/lib/typescript/src/specs/RNMBXRasterParticleLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/utils/MapboxStyles.d.ts +44 -2
- package/lib/typescript/src/utils/MapboxStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/styleMap.d.ts.map +1 -1
- package/package.json +13 -1
- package/plugin/build/withMapbox.js +1 -1
- package/plugin/src/withMapbox.ts +13 -3
- package/rnmapbox-maps.podspec +1 -1
- package/src/Mapbox.native.ts +3 -0
- package/src/RNMBXModule.ts +1 -4
- package/src/components/PointAnnotation.tsx +2 -2
- package/src/components/RasterArraySource.tsx +134 -0
- package/src/components/RasterParticleLayer.tsx +117 -0
- package/src/modules/offline/offlineManagerLegacy.ts +14 -0
- package/src/specs/RNMBXRasterArraySourceNativeComponent.ts +22 -0
- package/src/specs/RNMBXRasterParticleLayerNativeComponent.ts +39 -0
- package/src/utils/MapboxStyles.ts +47 -1
- package/src/utils/styleMap.ts +10 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NativeModules } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { cloneReactChildrenWithProps } from '../utils';
|
|
5
|
+
import { BaseProps } from '../types/BaseProps';
|
|
6
|
+
import RNMBXRasterArraySourceNativeComponent from '../specs/RNMBXRasterArraySourceNativeComponent';
|
|
7
|
+
|
|
8
|
+
import AbstractSource from './AbstractSource';
|
|
9
|
+
|
|
10
|
+
const Mapbox = NativeModules.RNMBXModule;
|
|
11
|
+
|
|
12
|
+
const isTileTemplateUrl = (url?: string): url is string =>
|
|
13
|
+
!!url &&
|
|
14
|
+
(url.includes('{z}') || url.includes('{bbox-') || url.includes('{quadkey}'));
|
|
15
|
+
|
|
16
|
+
type Props = BaseProps & {
|
|
17
|
+
/**
|
|
18
|
+
* A string that uniquely identifies the source.
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The id refers to an existing source in the style. Does not create a new source.
|
|
24
|
+
*/
|
|
25
|
+
existing?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A URL to a TileJSON configuration file describing the source's contents and other metadata.
|
|
29
|
+
*/
|
|
30
|
+
url?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.
|
|
34
|
+
* Example: https://example.com/raster-tiles/{z}/{x}/{y}.png
|
|
35
|
+
*/
|
|
36
|
+
tileUrlTemplates?: string[];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.
|
|
40
|
+
* The value should be between 0 and 22, inclusive, and less than
|
|
41
|
+
* maxZoomLevel, if specified. The default value for this option is 0.
|
|
42
|
+
*/
|
|
43
|
+
minZoomLevel?: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* An unsigned integer that specifies the maximum zoom level at which to display tiles from the source.
|
|
47
|
+
* The value should be between 0 and 22, inclusive, and less than
|
|
48
|
+
* minZoomLevel, if specified. The default value for this option is 22.
|
|
49
|
+
*/
|
|
50
|
+
maxZoomLevel?: number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Size of the map tiles.
|
|
54
|
+
* Defaults to 512.
|
|
55
|
+
*
|
|
56
|
+
* @platform android
|
|
57
|
+
* Note: This property is not supported on iOS due to SDK limitations.
|
|
58
|
+
* On iOS, tileSize will be derived from the TileJSON when using url, or use the default value.
|
|
59
|
+
* If you need custom tile size on iOS, include it in your TileJSON response.
|
|
60
|
+
*/
|
|
61
|
+
tileSize?: number;
|
|
62
|
+
|
|
63
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* An array containing the longitude and latitude of the southwest and northeast corners of
|
|
67
|
+
* the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`.
|
|
68
|
+
* When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.
|
|
69
|
+
*
|
|
70
|
+
* @platform android
|
|
71
|
+
* Note: This property is not supported on iOS due to SDK limitations.
|
|
72
|
+
* On iOS, bounds will be derived from the TileJSON when using url.
|
|
73
|
+
* If you need custom bounds on iOS, include them in your TileJSON response.
|
|
74
|
+
*/
|
|
75
|
+
sourceBounds?: number[];
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
type NativeProps = Props;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* RasterArraySource is a map content source that supplies raster array image tiles to be shown on the map.
|
|
82
|
+
* This is typically used for particle animations like wind or precipitation patterns.
|
|
83
|
+
* The location of and metadata about the tiles are defined either by an option dictionary
|
|
84
|
+
* or by an external file that conforms to the TileJSON specification.
|
|
85
|
+
*
|
|
86
|
+
* @experimental This component requires Mapbox Maps SDK v11.4.0 or later
|
|
87
|
+
*/
|
|
88
|
+
class RasterArraySource extends AbstractSource<Props, NativeProps> {
|
|
89
|
+
static defaultProps: Props = {
|
|
90
|
+
id: Mapbox.StyleSource.DefaultSourceID,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
constructor(props: Props) {
|
|
94
|
+
super(props);
|
|
95
|
+
if (isTileTemplateUrl(props.url)) {
|
|
96
|
+
console.warn(
|
|
97
|
+
`RasterArraySource 'url' property contains a Tile URL Template, but is intended for a StyleJSON URL. Please migrate your RasterArraySource to use: \`tileUrlTemplates=["${props.url}"]\` instead.`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
render() {
|
|
103
|
+
let { url } = this.props;
|
|
104
|
+
let { tileUrlTemplates } = this.props;
|
|
105
|
+
|
|
106
|
+
// Swapping url for tileUrlTemplates to provide backward compatibility
|
|
107
|
+
// when RasterArraySource supported only tile url as url prop
|
|
108
|
+
if (isTileTemplateUrl(url)) {
|
|
109
|
+
tileUrlTemplates = [url];
|
|
110
|
+
url = undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const props = {
|
|
114
|
+
...this.props,
|
|
115
|
+
id: this.props.id,
|
|
116
|
+
existing: this.props.existing,
|
|
117
|
+
url,
|
|
118
|
+
tileUrlTemplates,
|
|
119
|
+
minZoomLevel: this.props.minZoomLevel,
|
|
120
|
+
maxZoomLevel: this.props.maxZoomLevel,
|
|
121
|
+
tileSize: this.props.tileSize,
|
|
122
|
+
};
|
|
123
|
+
return (
|
|
124
|
+
// @ts-expect-error just codegen stuff
|
|
125
|
+
<RNMBXRasterArraySourceNativeComponent ref={this.setNativeRef} {...props}>
|
|
126
|
+
{cloneReactChildrenWithProps(this.props.children, {
|
|
127
|
+
sourceID: this.props.id,
|
|
128
|
+
})}
|
|
129
|
+
</RNMBXRasterArraySourceNativeComponent>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export default RasterArraySource;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NativeModules } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
FilterExpression,
|
|
6
|
+
RasterParticleLayerStyleProps,
|
|
7
|
+
} from '../utils/MapboxStyles';
|
|
8
|
+
import { StyleValue } from '../utils/StyleValue';
|
|
9
|
+
import RNMBXRasterParticleLayerNativeComponent from '../specs/RNMBXRasterParticleLayerNativeComponent';
|
|
10
|
+
|
|
11
|
+
import AbstractLayer from './AbstractLayer';
|
|
12
|
+
|
|
13
|
+
const Mapbox = NativeModules.RNMBXModule;
|
|
14
|
+
|
|
15
|
+
// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)}
|
|
16
|
+
type Slot = 'bottom' | 'middle' | 'top';
|
|
17
|
+
|
|
18
|
+
type LayerPropsCommon = {
|
|
19
|
+
/**
|
|
20
|
+
* A string that uniquely identifies the source in the style to which it is added.
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The id refers to an existing layer in the style. Does not create a new layer.
|
|
26
|
+
*/
|
|
27
|
+
existing?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The source from which to obtain the data to style.
|
|
31
|
+
* If the source has not yet been added to the current style, the behavior is undefined.
|
|
32
|
+
* Inferred from parent source only if the layer is a direct child to it.
|
|
33
|
+
*/
|
|
34
|
+
sourceID?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style.
|
|
38
|
+
*/
|
|
39
|
+
sourceLayerID?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Inserts a layer above aboveLayerID.
|
|
43
|
+
*/
|
|
44
|
+
aboveLayerID?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Inserts a layer below belowLayerID
|
|
48
|
+
*/
|
|
49
|
+
belowLayerID?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Inserts a layer at a specified index
|
|
53
|
+
*/
|
|
54
|
+
layerIndex?: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Filter only the features in the source layer that satisfy a condition that you define
|
|
58
|
+
*/
|
|
59
|
+
filter?: FilterExpression;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The minimum zoom level at which the layer gets parsed and appears.
|
|
63
|
+
*/
|
|
64
|
+
minZoomLevel?: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The maximum zoom level at which the layer gets parsed and appears.
|
|
68
|
+
*/
|
|
69
|
+
maxZoomLevel?: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.
|
|
73
|
+
*
|
|
74
|
+
* v11 only
|
|
75
|
+
*/
|
|
76
|
+
slot?: Slot;
|
|
77
|
+
};
|
|
78
|
+
// @{codepart-replace-end}
|
|
79
|
+
|
|
80
|
+
export type Props = LayerPropsCommon & {
|
|
81
|
+
/**
|
|
82
|
+
* Customizable style attributes
|
|
83
|
+
*/
|
|
84
|
+
style: RasterParticleLayerStyleProps;
|
|
85
|
+
} & React.ComponentProps<typeof AbstractLayer>;
|
|
86
|
+
|
|
87
|
+
type NativeTypeProps = Omit<Props, 'style'> & {
|
|
88
|
+
reactStyle?: { [key: string]: StyleValue };
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* RasterParticleLayer renders a particle animation driven by velocity data from a raster array source.
|
|
93
|
+
* This is typically used to visualize wind patterns, ocean currents, or other directional flow data.
|
|
94
|
+
*
|
|
95
|
+
* @experimental This component requires Mapbox Maps SDK v11.4.0 or later
|
|
96
|
+
*/
|
|
97
|
+
class RasterParticleLayer extends AbstractLayer<Props, NativeTypeProps> {
|
|
98
|
+
static defaultProps = {
|
|
99
|
+
sourceID: Mapbox.StyleSource.DefaultSourceID,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
render() {
|
|
103
|
+
const props = {
|
|
104
|
+
...this.baseProps,
|
|
105
|
+
sourceLayerID: this.props.sourceLayerID,
|
|
106
|
+
};
|
|
107
|
+
return (
|
|
108
|
+
// @ts-expect-error just codegen stuff
|
|
109
|
+
<RNMBXRasterParticleLayerNativeComponent
|
|
110
|
+
ref={this.setNativeLayer}
|
|
111
|
+
{...props}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export default RasterParticleLayer;
|
|
@@ -159,6 +159,20 @@ class OfflineManagerLegacy {
|
|
|
159
159
|
return this._offlinePacks[name];
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device.
|
|
164
|
+
* The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* Mapbox.offlineManagerLegacy.setTileCountLimit(1000);
|
|
168
|
+
*
|
|
169
|
+
* @param {Number} limit Map tile limit count.
|
|
170
|
+
* @return {void}
|
|
171
|
+
*/
|
|
172
|
+
setTileCountLimit(limit: number): void {
|
|
173
|
+
MapboxOfflineManager.setTileCountLimit(limit);
|
|
174
|
+
}
|
|
175
|
+
|
|
162
176
|
async _initialize(forceInit?: boolean): Promise<boolean> {
|
|
163
177
|
if (this._hasInitialized && !forceInit) {
|
|
164
178
|
return true;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
+
// @ts-ignore - CI environment type resolution issue for CodegenTypes
|
|
4
|
+
import { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
|
+
|
|
6
|
+
import { UnsafeMixed } from './codegenUtils';
|
|
7
|
+
|
|
8
|
+
export interface NativeProps extends ViewProps {
|
|
9
|
+
id: UnsafeMixed<string>;
|
|
10
|
+
existing: UnsafeMixed<boolean>;
|
|
11
|
+
url: UnsafeMixed<string>;
|
|
12
|
+
tileUrlTemplates: UnsafeMixed<Array<string>>;
|
|
13
|
+
minZoomLevel: UnsafeMixed<Double>;
|
|
14
|
+
maxZoomLevel: UnsafeMixed<Double>;
|
|
15
|
+
tileSize: UnsafeMixed<Double>;
|
|
16
|
+
sourceBounds: UnsafeMixed<Array<number>>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast
|
|
20
|
+
export default codegenNativeComponent<NativeProps>(
|
|
21
|
+
'RNMBXRasterArraySource',
|
|
22
|
+
) as HostComponent<NativeProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
+
// @ts-ignore - CI environment type resolution issue for CodegenTypes
|
|
4
|
+
import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
|
+
|
|
6
|
+
import type { FilterExpression } from '../utils/MapboxStyles';
|
|
7
|
+
|
|
8
|
+
import type { UnsafeMixed } from './codegenUtils';
|
|
9
|
+
|
|
10
|
+
// @{codepart-replace-start(CommonLayerNativeComponentsProps.codepart-ts)}
|
|
11
|
+
// see https://github.com/rnmapbox/maps/wiki/FabricOptionalProp
|
|
12
|
+
type OptionalProp<T> = UnsafeMixed<T>;
|
|
13
|
+
type Slot = 'bottom' | 'middle' | 'top';
|
|
14
|
+
|
|
15
|
+
type CommonProps = {
|
|
16
|
+
sourceID?: OptionalProp<string>;
|
|
17
|
+
existing?: OptionalProp<boolean>;
|
|
18
|
+
filter?: UnsafeMixed<FilterExpression>;
|
|
19
|
+
|
|
20
|
+
aboveLayerID?: OptionalProp<string>;
|
|
21
|
+
belowLayerID?: OptionalProp<string>;
|
|
22
|
+
layerIndex?: OptionalProp<Int32>;
|
|
23
|
+
|
|
24
|
+
maxZoomLevel?: OptionalProp<Double>;
|
|
25
|
+
minZoomLevel?: OptionalProp<Double>;
|
|
26
|
+
sourceLayerID?: OptionalProp<string>;
|
|
27
|
+
slot?: OptionalProp<Slot>;
|
|
28
|
+
};
|
|
29
|
+
// @{codepart-replace-end}
|
|
30
|
+
|
|
31
|
+
export interface NativeProps extends ViewProps, CommonProps {
|
|
32
|
+
id?: OptionalProp<string>;
|
|
33
|
+
reactStyle: UnsafeMixed<any>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast
|
|
37
|
+
export default codegenNativeComponent<NativeProps>(
|
|
38
|
+
'RNMBXRasterParticleLayer',
|
|
39
|
+
) as HostComponent<NativeProps>;
|
|
@@ -125,7 +125,8 @@ type ExpressionParameters =
|
|
|
125
125
|
| 'line-progress'
|
|
126
126
|
| 'heatmap-density'
|
|
127
127
|
| 'measure-light'
|
|
128
|
-
| 'raster-value'
|
|
128
|
+
| 'raster-value'
|
|
129
|
+
| 'raster-particle-speed';
|
|
129
130
|
|
|
130
131
|
type ResolvedImageType = ImageSourcePropType | string;
|
|
131
132
|
|
|
@@ -1913,6 +1914,50 @@ export interface RasterLayerStyleProps {
|
|
|
1913
1914
|
*/
|
|
1914
1915
|
rasterElevationTransition?: Transition;
|
|
1915
1916
|
}
|
|
1917
|
+
export interface RasterParticleLayerStyleProps {
|
|
1918
|
+
/**
|
|
1919
|
+
* Whether this layer is displayed.
|
|
1920
|
+
*/
|
|
1921
|
+
visibility?: Value<Enum<VisibilityEnum, VisibilityEnumValues>>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Displayed band of raster array source layer
|
|
1924
|
+
*/
|
|
1925
|
+
rasterParticleArrayBand?: string;
|
|
1926
|
+
/**
|
|
1927
|
+
* Defines the amount of particles per tile.
|
|
1928
|
+
*/
|
|
1929
|
+
rasterParticleCount?: number;
|
|
1930
|
+
/**
|
|
1931
|
+
* Defines a color map by which to colorize a raster particle layer, parameterized by the `["rasterParticleSpeed"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `rasterParticleMaxSpeed`.
|
|
1932
|
+
*/
|
|
1933
|
+
rasterParticleColor?: Value<string, ['raster-particle-speed']>;
|
|
1934
|
+
/**
|
|
1935
|
+
* Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.
|
|
1936
|
+
*/
|
|
1937
|
+
rasterParticleMaxSpeed?: number;
|
|
1938
|
+
/**
|
|
1939
|
+
* Defines a coefficient for the speed of particles’ motion.
|
|
1940
|
+
*/
|
|
1941
|
+
rasterParticleSpeedFactor?: Value<number, ['zoom']>;
|
|
1942
|
+
|
|
1943
|
+
/**
|
|
1944
|
+
* The transition affecting any changes to this layer’s rasterParticleSpeedFactor property.
|
|
1945
|
+
*/
|
|
1946
|
+
rasterParticleSpeedFactorTransition?: Transition;
|
|
1947
|
+
/**
|
|
1948
|
+
* Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.
|
|
1949
|
+
*/
|
|
1950
|
+
rasterParticleFadeOpacityFactor?: Value<number, ['zoom']>;
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* The transition affecting any changes to this layer’s rasterParticleFadeOpacityFactor property.
|
|
1954
|
+
*/
|
|
1955
|
+
rasterParticleFadeOpacityFactorTransition?: Transition;
|
|
1956
|
+
/**
|
|
1957
|
+
* Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).
|
|
1958
|
+
*/
|
|
1959
|
+
rasterParticleResetRateFactor?: number;
|
|
1960
|
+
}
|
|
1916
1961
|
export interface HillshadeLayerStyleProps {
|
|
1917
1962
|
/**
|
|
1918
1963
|
* Whether this layer is displayed.
|
|
@@ -2307,6 +2352,7 @@ export type AllLayerStyleProps =
|
|
|
2307
2352
|
| HeatmapLayerStyleProps
|
|
2308
2353
|
| FillExtrusionLayerStyleProps
|
|
2309
2354
|
| RasterLayerStyleProps
|
|
2355
|
+
| RasterParticleLayerStyleProps
|
|
2310
2356
|
| HillshadeLayerStyleProps
|
|
2311
2357
|
| ModelLayerStyleProps
|
|
2312
2358
|
| BackgroundLayerStyleProps
|
package/src/utils/styleMap.ts
CHANGED
|
@@ -265,6 +265,16 @@ const styleMap = {
|
|
|
265
265
|
rasterElevation: StyleTypes.Constant,
|
|
266
266
|
rasterElevationTransition: StyleTypes.Transition,
|
|
267
267
|
|
|
268
|
+
rasterParticleArrayBand: StyleTypes.Constant,
|
|
269
|
+
rasterParticleCount: StyleTypes.Constant,
|
|
270
|
+
rasterParticleColor: StyleTypes.Color,
|
|
271
|
+
rasterParticleMaxSpeed: StyleTypes.Constant,
|
|
272
|
+
rasterParticleSpeedFactor: StyleTypes.Constant,
|
|
273
|
+
rasterParticleSpeedFactorTransition: StyleTypes.Transition,
|
|
274
|
+
rasterParticleFadeOpacityFactor: StyleTypes.Constant,
|
|
275
|
+
rasterParticleFadeOpacityFactorTransition: StyleTypes.Transition,
|
|
276
|
+
rasterParticleResetRateFactor: StyleTypes.Constant,
|
|
277
|
+
|
|
268
278
|
hillshadeIlluminationDirection: StyleTypes.Constant,
|
|
269
279
|
hillshadeIlluminationAnchor: StyleTypes.Enum,
|
|
270
280
|
hillshadeExaggeration: StyleTypes.Constant,
|