@maplibre/maplibre-react-native 9.0.1 → 10.0.0-alpha.1
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/.eslintrc.js +10 -2
- package/.husky/pre-commit +5 -0
- package/.yarn/plugins/@yarnpkg/plugin-typescript.cjs +9 -0
- package/.yarn/sdks/eslint/bin/eslint.js +20 -0
- package/.yarn/sdks/eslint/lib/api.js +20 -0
- package/.yarn/sdks/eslint/package.json +6 -0
- package/.yarn/sdks/integrations.yml +5 -0
- package/.yarn/sdks/prettier/index.js +20 -0
- package/.yarn/sdks/prettier/package.json +6 -0
- package/.yarn/sdks/typescript/bin/tsc +20 -0
- package/.yarn/sdks/typescript/bin/tsserver +20 -0
- package/.yarn/sdks/typescript/lib/tsc.js +20 -0
- package/.yarn/sdks/typescript/lib/tsserver.js +225 -0
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +225 -0
- package/.yarn/sdks/typescript/lib/typescript.js +20 -0
- package/.yarn/sdks/typescript/package.json +6 -0
- package/CHANGELOG.md +15 -1
- package/android/build.gradle +2 -2
- package/android/rctmgl/build.gradle +2 -4
- package/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/sources/RCTMGLShapeSource.java +14 -0
- package/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/sources/RCTMGLShapeSourceManager.java +26 -0
- package/android/rctmgl/src/main/java/com/mapbox/rctmgl/utils/ClusterPropertyEntry.java +13 -0
- package/docs/Annotation.md +8 -9
- package/docs/BackgroundLayer.md +2 -10
- package/docs/Callout.md +5 -5
- package/docs/Camera.md +18 -47
- package/docs/CircleLayer.md +2 -10
- package/docs/FillExtrusionLayer.md +2 -10
- package/docs/FillLayer.md +2 -10
- package/docs/HeatmapLayer.md +2 -10
- package/docs/ImageSource.md +3 -2
- package/docs/Images.md +5 -3
- package/docs/Light.md +1 -1
- package/docs/LineLayer.md +2 -10
- package/docs/MapView.md +53 -37
- package/docs/MarkerView.md +4 -2
- package/docs/NativeUserLocation.md +2 -2
- package/docs/PointAnnotation.md +5 -8
- package/docs/RasterLayer.md +2 -10
- package/docs/RasterSource.md +3 -2
- package/docs/ShapeSource.md +12 -6
- package/docs/Style.md +1 -1
- package/docs/SymbolLayer.md +3 -10
- package/docs/UserLocation.md +8 -10
- package/docs/VectorSource.md +6 -5
- package/docs/coordinates.md +6 -0
- package/docs/docs.json +561 -1308
- package/docs/location.md +6 -0
- package/docs/snapshotManager.md +3 -3
- package/ios/RCTMGL/RCTMGLShapeSource.h +1 -0
- package/ios/RCTMGL/RCTMGLShapeSource.m +14 -0
- package/ios/RCTMGL/RCTMGLShapeSourceManager.m +1 -0
- package/ios/RCTMGL.xcodeproj/project.pbxproj +1 -0
- package/javascript/@types/assets.d.ts +4 -0
- package/javascript/MGLModule.ts +37 -0
- package/javascript/Maplibre.ts +65 -0
- package/javascript/components/AbstractLayer.tsx +107 -0
- package/javascript/components/AbstractSource.tsx +27 -0
- package/javascript/components/BackgroundLayer.tsx +43 -0
- package/javascript/components/{Callout.js → Callout.tsx} +67 -65
- package/javascript/components/{Camera.js → Camera.tsx} +266 -251
- package/javascript/components/CircleLayer.tsx +46 -0
- package/javascript/components/FillExtrusionLayer.tsx +47 -0
- package/javascript/components/FillLayer.tsx +41 -0
- package/javascript/components/{HeadingIndicator.js → HeadingIndicator.tsx} +8 -8
- package/javascript/components/HeatmapLayer.tsx +44 -0
- package/javascript/components/ImageSource.tsx +78 -0
- package/javascript/components/Images.tsx +134 -0
- package/javascript/components/Light.tsx +67 -0
- package/javascript/components/LineLayer.tsx +42 -0
- package/javascript/components/{MapView.js → MapView.tsx} +365 -354
- package/javascript/components/MarkerView.tsx +104 -0
- package/javascript/components/{NativeBridgeComponent.js → NativeBridgeComponent.tsx} +44 -13
- package/javascript/components/NativeUserLocation.tsx +33 -0
- package/javascript/components/PointAnnotation.tsx +221 -0
- package/javascript/components/RasterLayer.tsx +41 -0
- package/javascript/components/RasterSource.tsx +117 -0
- package/javascript/components/ShapeSource.tsx +383 -0
- package/javascript/components/{Style.js → Style.tsx} +132 -38
- package/javascript/components/SymbolLayer.tsx +72 -0
- package/javascript/components/{UserLocation.js → UserLocation.tsx} +111 -110
- package/javascript/components/VectorSource.tsx +207 -0
- package/javascript/components/annotations/Annotation.tsx +134 -0
- package/javascript/index.ts +4 -0
- package/javascript/modules/location/{locationManager.js → locationManager.ts} +71 -10
- package/javascript/modules/offline/{OfflineCreatePackOptions.js → OfflineCreatePackOptions.ts} +20 -4
- package/javascript/modules/offline/{OfflinePack.js → OfflinePack.ts} +23 -7
- package/javascript/modules/offline/{offlineManager.js → offlineManager.ts} +81 -24
- package/javascript/modules/snapshot/{SnapshotOptions.js → SnapshotOptions.ts} +43 -6
- package/javascript/modules/snapshot/{snapshotManager.js → snapshotManager.ts} +5 -5
- package/javascript/requestAndroidLocationPermissions.ts +29 -0
- package/javascript/types/BaseProps.ts +5 -0
- package/javascript/types/OnPressEvent.ts +13 -0
- package/javascript/types/index.ts +7 -0
- package/javascript/utils/BridgeValue.ts +90 -0
- package/javascript/utils/{Logger.js → Logger.ts} +37 -18
- package/javascript/utils/MaplibreStyles.d.ts +1486 -0
- package/javascript/utils/StyleValue.ts +49 -0
- package/javascript/utils/animated/AbstractAnimatedCoordinates.ts +134 -0
- package/javascript/utils/animated/AnimatedCoordinatesArray.ts +112 -0
- package/javascript/utils/animated/{AnimatedExtractCoordinateFromArray.js → AnimatedExtractCoordinateFromArray.ts} +5 -5
- package/javascript/utils/animated/{AnimatedPoint.js → AnimatedPoint.ts} +20 -12
- package/javascript/utils/animated/{AnimatedRouteCoordinatesArray.js → AnimatedRouteCoordinatesArray.ts} +39 -14
- package/javascript/utils/animated/{AnimatedShape.js → AnimatedShape.ts} +31 -10
- package/javascript/utils/{deprecation.js → deprecation.ts} +9 -6
- package/javascript/utils/filterUtils.ts +9 -0
- package/javascript/utils/geoUtils.ts +79 -0
- package/javascript/utils/{index.js → index.ts} +44 -24
- package/javascript/utils/styleMap.ts +264 -0
- package/package.json +43 -34
- package/plugin/build/withMapLibre.js +3 -2
- package/scripts/autogenHelpers/globals.js +1 -1
- package/scripts/autogenerate.js +14 -6
- package/scripts/templates/MaplibreStyles.ts.ejs +99 -0
- package/scripts/templates/index.d.ts.ejs +71 -42
- package/scripts/templates/{styleMap.js.ejs → styleMap.ts.ejs} +3 -33
- package/setup-jest.js +3 -10
- package/tsconfig.json +20 -61
- package/index.d.ts +0 -954
- package/javascript/components/AbstractLayer.js +0 -75
- package/javascript/components/AbstractSource.js +0 -15
- package/javascript/components/BackgroundLayer.js +0 -97
- package/javascript/components/CircleLayer.js +0 -101
- package/javascript/components/FillExtrusionLayer.js +0 -98
- package/javascript/components/FillLayer.js +0 -94
- package/javascript/components/HeatmapLayer.js +0 -99
- package/javascript/components/ImageSource.js +0 -82
- package/javascript/components/Images.js +0 -119
- package/javascript/components/Light.js +0 -47
- package/javascript/components/LineLayer.js +0 -94
- package/javascript/components/MarkerView.js +0 -87
- package/javascript/components/NativeUserLocation.js +0 -41
- package/javascript/components/PointAnnotation.js +0 -216
- package/javascript/components/RasterLayer.js +0 -95
- package/javascript/components/RasterSource.js +0 -124
- package/javascript/components/ShapeSource.js +0 -357
- package/javascript/components/SymbolLayer.js +0 -120
- package/javascript/components/VectorSource.js +0 -200
- package/javascript/components/annotations/Annotation.js +0 -122
- package/javascript/index.js +0 -149
- package/javascript/utils/BridgeValue.js +0 -81
- package/javascript/utils/animated/AnimatedCoordinatesArray.js +0 -191
- package/javascript/utils/filterUtils.js +0 -7
- package/javascript/utils/geoUtils.js +0 -73
- package/javascript/utils/styleMap.js +0 -1932
- /package/javascript/utils/animated/{Animated.js → Animated.ts} +0 -0
package/index.d.ts
DELETED
|
@@ -1,954 +0,0 @@
|
|
|
1
|
-
declare module 'maplibre__maplibre-react-native';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Component,
|
|
5
|
-
ReactNode,
|
|
6
|
-
SyntheticEvent,
|
|
7
|
-
} from 'react';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
ViewProps,
|
|
11
|
-
ViewStyle,
|
|
12
|
-
StyleProp,
|
|
13
|
-
TextStyle,
|
|
14
|
-
ImageSourcePropType,
|
|
15
|
-
} from 'react-native';
|
|
16
|
-
import ReactNative from 'react-native';
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
Geometry,
|
|
20
|
-
Properties,
|
|
21
|
-
Position,
|
|
22
|
-
Feature,
|
|
23
|
-
LineString,
|
|
24
|
-
Coord,
|
|
25
|
-
Units,
|
|
26
|
-
BBox,
|
|
27
|
-
Id,
|
|
28
|
-
FeatureCollection,
|
|
29
|
-
} from '@turf/helpers';
|
|
30
|
-
|
|
31
|
-
// prettier-ignore
|
|
32
|
-
type ExpressionName =
|
|
33
|
-
// Types
|
|
34
|
-
| 'array' | 'boolean' | 'collator' | 'format' | 'literal' | 'number' | 'object' | 'string'
|
|
35
|
-
| 'to-boolean' | 'to-color' | 'to-number' | 'to-string' | 'typeof'
|
|
36
|
-
// Feature data
|
|
37
|
-
| 'feature-state' | 'geometry-type' | 'id' | 'line-progress' | 'properties'
|
|
38
|
-
// Lookup
|
|
39
|
-
| 'at' | 'get' | 'has' | 'length'
|
|
40
|
-
// Decision
|
|
41
|
-
| '!' | '!=' | '<' | '<=' | '==' | '>' | '>=' | 'all' | 'any' | 'case' | 'match' | 'coalesce'
|
|
42
|
-
// Ramps, scales, curves
|
|
43
|
-
| 'interpolate' | 'interpolate-hcl' | 'interpolate-lab' | 'step'
|
|
44
|
-
// Variable binding
|
|
45
|
-
| 'let' | 'var'
|
|
46
|
-
// String
|
|
47
|
-
| 'concat' | 'downcase' | 'is-supported-script' | 'resolved-locale' | 'upcase'
|
|
48
|
-
// Color
|
|
49
|
-
| 'rgb' | 'rgba'
|
|
50
|
-
// Math
|
|
51
|
-
| '-' | '*' | '/' | '%' | '^' | '+' | 'abs' | 'acos' | 'asin' | 'atan' | 'ceil' | 'cos' | 'e'
|
|
52
|
-
| 'floor' | 'ln' | 'ln2' | 'log10' | 'log2' | 'max' | 'min' | 'pi' | 'round' | 'sin' | 'sqrt' | 'tan'
|
|
53
|
-
// Zoom, Heatmap
|
|
54
|
-
| 'zoom' | 'heatmap-density';
|
|
55
|
-
|
|
56
|
-
type ExpressionField =
|
|
57
|
-
| string
|
|
58
|
-
| number
|
|
59
|
-
| boolean
|
|
60
|
-
| Expression
|
|
61
|
-
| ExpressionField[]
|
|
62
|
-
| {[key: string]: ExpressionField};
|
|
63
|
-
|
|
64
|
-
export type Expression = [ExpressionName, ...ExpressionField[]];
|
|
65
|
-
|
|
66
|
-
type Anchor =
|
|
67
|
-
| 'center'
|
|
68
|
-
| 'left'
|
|
69
|
-
| 'right'
|
|
70
|
-
| 'top'
|
|
71
|
-
| 'bottom'
|
|
72
|
-
| 'top-left'
|
|
73
|
-
| 'top-right'
|
|
74
|
-
| 'bottom-left'
|
|
75
|
-
| 'bottom-right';
|
|
76
|
-
type Visibility = 'visible' | 'none';
|
|
77
|
-
type Alignment = 'map' | 'viewport';
|
|
78
|
-
type AutoAlignment = Alignment | 'auto';
|
|
79
|
-
|
|
80
|
-
type NamedStyles<T> = {
|
|
81
|
-
[P in keyof T]:
|
|
82
|
-
| SymbolLayerStyle
|
|
83
|
-
| RasterLayerStyle
|
|
84
|
-
| LineLayerStyle
|
|
85
|
-
| FillLayerStyle
|
|
86
|
-
| FillExtrusionLayerStyle
|
|
87
|
-
| CircleLayerStyle
|
|
88
|
-
| BackgroundLayerStyle;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type MapLibreGLEvent<
|
|
92
|
-
T extends string,
|
|
93
|
-
P = GeoJSON.Feature,
|
|
94
|
-
V = Element
|
|
95
|
-
> = SyntheticEvent<V, { type: T; payload: P }>;
|
|
96
|
-
|
|
97
|
-
export type OnPressEvent = {
|
|
98
|
-
features: Array<GeoJSON.Feature>;
|
|
99
|
-
coordinates: {
|
|
100
|
-
latitude: number;
|
|
101
|
-
longitude: number;
|
|
102
|
-
};
|
|
103
|
-
point: {
|
|
104
|
-
x: number;
|
|
105
|
-
y: number;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
declare namespace MapLibreGL {
|
|
110
|
-
function removeCustomHeader(headerName: string): void;
|
|
111
|
-
function addCustomHeader(headerName: string, headerValue: string): void;
|
|
112
|
-
function setAccessToken(accessToken: string | null): void;
|
|
113
|
-
function getAccessToken(): Promise<string>;
|
|
114
|
-
function setConnected(connected: boolean): void;
|
|
115
|
-
function requestAndroidLocationPermissions(): Promise<boolean>;
|
|
116
|
-
|
|
117
|
-
const offlineManager: OfflineManager;
|
|
118
|
-
const snapshotManager: SnapshotManager;
|
|
119
|
-
const locationManager: LocationManager;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* GeoUtils
|
|
123
|
-
*/
|
|
124
|
-
interface UnitsOptions {
|
|
125
|
-
units?: Units;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
interface PositionsOptions {
|
|
129
|
-
bbox?: BBox;
|
|
130
|
-
id?: Id;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
namespace geoUtils {
|
|
134
|
-
function makePoint<P = Properties>(coordinates: Position, properties?: P, options?: PositionsOptions): Feature<GeoJSON.Point, P>;
|
|
135
|
-
function makeLineString<P = Properties>(coordinates: Position[], properties?: P, options?: PositionsOptions): Feature<LineString, P>;
|
|
136
|
-
function makeLatLngBounds<G = Geometry, P = Properties>(northEastCoordinates: Position[], southWestCoordinates: Position[]): FeatureCollection<G, P>;
|
|
137
|
-
function makeFeature<G = Geometry, P = Properties>(geometry: G, properties?: P): Feature<G, P>;
|
|
138
|
-
function makeFeatureCollection<G = Geometry, P = Properties>(features: Array<Feature<G, P>>, options?: PositionsOptions): FeatureCollection<G, P>;
|
|
139
|
-
function addToFeatureCollection<G = Geometry, P = Properties>(newFeatureCollection: Array<FeatureCollection<G, P>>, newFeature: Feature<G, P>): FeatureCollection<G, P>;
|
|
140
|
-
function calculateDistance(origin: Coord, dest: Coord, options?: UnitsOptions): number;
|
|
141
|
-
function pointAlongLine(newLineString: Feature<LineString> | LineString, distAlong: number, options?: UnitsOptions): Feature<GeoJSON.Point>;
|
|
142
|
-
function getOrCalculateVisibleRegion(coord: { lon: number; lat: number }, zoomLevel: number, width: number, height: number, nativeRegion: { properties: { visibleBounds: number[] }; visibleBounds: number[] }): void;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
namespace Animated {
|
|
146
|
-
// sources
|
|
147
|
-
class ShapeSource extends Component<ShapeSourceProps> { }
|
|
148
|
-
class ImageSource extends Component<ImageSourceProps> { }
|
|
149
|
-
|
|
150
|
-
// layers
|
|
151
|
-
class FillLayer extends Component<FillLayerProps> { }
|
|
152
|
-
class FillExtrusionLayer extends Component<FillExtrusionLayerProps> { }
|
|
153
|
-
class LineLayer extends Component<LineLayerProps> { }
|
|
154
|
-
class CircleLayer extends Component<CircleLayerProps> { }
|
|
155
|
-
class SymbolLayer extends Component<SymbolLayerProps> { }
|
|
156
|
-
class RasterLayer extends Component<RasterLayerProps> { }
|
|
157
|
-
class BackgroundLayer extends Component<BackgroundLayerProps> { }
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Classes
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
class AnimatedPoint {
|
|
165
|
-
constructor(point?: GeoJSON.Point);
|
|
166
|
-
longitude: ReactNative.Animated.Value<number>;
|
|
167
|
-
latitude: ReactNative.Animated.Value<number>;
|
|
168
|
-
setValue: (point: GeoJSON.Point) => void;
|
|
169
|
-
setOffset: (point: GeoJSON.Point) => void;
|
|
170
|
-
flattenOffset: () => void;
|
|
171
|
-
stopAnimation: (cb?: () => GeoJSON.Point) => void;
|
|
172
|
-
addListener: (cb?: () => GeoJSON.Point) => void;
|
|
173
|
-
removeListener: (id: string) => void;
|
|
174
|
-
spring: (config: Record<string, any>) => ReactNative.Animated.CompositeAnimation;
|
|
175
|
-
timing: (config: Record<string, any>) => ReactNative.Animated.CompositeAnimation;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Components
|
|
180
|
-
*/
|
|
181
|
-
class MapView extends Component<MapViewProps> {
|
|
182
|
-
getPointInView(coordinate: GeoJSON.Position): Promise<GeoJSON.Position>;
|
|
183
|
-
getCoordinateFromView(point: GeoJSON.Position): Promise<GeoJSON.Position>;
|
|
184
|
-
getVisibleBounds(): Promise<GeoJSON.Position[]>;
|
|
185
|
-
queryRenderedFeaturesAtPoint(
|
|
186
|
-
coordinate: GeoJSON.Position,
|
|
187
|
-
filter?: Expression,
|
|
188
|
-
layerIds?: Array<string>,
|
|
189
|
-
): Promise<GeoJSON.FeatureCollection | undefined>;
|
|
190
|
-
queryRenderedFeaturesInRect(
|
|
191
|
-
coordinate: GeoJSON.Position,
|
|
192
|
-
filter?: Expression,
|
|
193
|
-
layerIds?: Array<string>,
|
|
194
|
-
): Promise<GeoJSON.FeatureCollection | undefined>;
|
|
195
|
-
takeSnap(writeToDisk?: boolean): Promise<string>;
|
|
196
|
-
getZoom(): Promise<number>;
|
|
197
|
-
getCenter(): Promise<GeoJSON.Position>;
|
|
198
|
-
showAttribution(): void;
|
|
199
|
-
setSourceVisibility(visible: Boolean, sourceId: string, sourceLayerId?: string): void;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
type Padding = number | [number, number] | [number, number, number, number];
|
|
203
|
-
class Camera extends Component<CameraProps> {
|
|
204
|
-
fitBounds(
|
|
205
|
-
northEastCoordinates: GeoJSON.Position,
|
|
206
|
-
southWestCoordinates: GeoJSON.Position,
|
|
207
|
-
padding?: Padding,
|
|
208
|
-
duration?: number,
|
|
209
|
-
): void;
|
|
210
|
-
flyTo(coordinates: GeoJSON.Position, duration?: number): void;
|
|
211
|
-
moveTo(coordinates: GeoJSON.Position, duration?: number): void;
|
|
212
|
-
zoomTo(zoomLevel: number, duration?: number): void;
|
|
213
|
-
setCamera(config: CameraSettings): void;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
class UserLocation extends Component<UserLocationProps> { }
|
|
217
|
-
|
|
218
|
-
interface Location {
|
|
219
|
-
coords: Coordinates;
|
|
220
|
-
timestamp?: number;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
interface Coordinates {
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* The heading (measured in degrees) relative to true north.
|
|
227
|
-
* Heading is used to describe the direction the device is pointing to (the value of the compass).
|
|
228
|
-
* Note that on Android this is incorrectly reporting the course value as mentioned in issue https://github.com/rnmapbox/maps/issues/1213.
|
|
229
|
-
* This is more likely to get fixed in MapLibre upstream if someone makes them aware of the issue.
|
|
230
|
-
*/
|
|
231
|
-
heading?: number;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* The direction in which the device is traveling, measured in degrees and relative to due north.
|
|
235
|
-
* The course refers to the direction the device is actually moving (not the same as heading).
|
|
236
|
-
*/
|
|
237
|
-
course?: number;
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* The instantaneous speed of the device, measured in meters per second.
|
|
241
|
-
*/
|
|
242
|
-
speed?: number;
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* The latitude in degrees.
|
|
246
|
-
*/
|
|
247
|
-
latitude: number;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* The longitude in degrees.
|
|
251
|
-
*/
|
|
252
|
-
longitude: number;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* The radius of uncertainty for the location, measured in meters.
|
|
256
|
-
*/
|
|
257
|
-
accuracy?: number;
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* The altitude, measured in meters.
|
|
261
|
-
*/
|
|
262
|
-
altitude?: number;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
class Light extends Component<LightProps> { }
|
|
266
|
-
|
|
267
|
-
class StyleSheet extends Component {
|
|
268
|
-
static create<T extends NamedStyles<T> | NamedStyles<any>>(styles: T): T;
|
|
269
|
-
camera(
|
|
270
|
-
stops: { [key: number]: string },
|
|
271
|
-
interpolationMode?: InterpolationMode,
|
|
272
|
-
): void;
|
|
273
|
-
source(
|
|
274
|
-
stops: { [key: number]: string },
|
|
275
|
-
attributeName: string,
|
|
276
|
-
interpolationMode?: InterpolationMode,
|
|
277
|
-
): void;
|
|
278
|
-
composite(
|
|
279
|
-
stops: { [key: number]: string },
|
|
280
|
-
attributeName: string,
|
|
281
|
-
interpolationMode?: InterpolationMode,
|
|
282
|
-
): void;
|
|
283
|
-
|
|
284
|
-
identity(attributeName: string): number;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
class PointAnnotation extends Component<PointAnnotationProps> {
|
|
288
|
-
refresh(): void;
|
|
289
|
-
}
|
|
290
|
-
class MarkerView extends Component<MarkerViewProps> { }
|
|
291
|
-
class Callout extends Component<CalloutProps> { }
|
|
292
|
-
interface Style extends React.FC<StyleProps> { }
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Sources
|
|
296
|
-
*/
|
|
297
|
-
class VectorSource extends Component<VectorSourceProps> { }
|
|
298
|
-
class ShapeSource extends Component<ShapeSourceProps> {
|
|
299
|
-
features(filter?: Expression): Promise<FeatureCollection<Geometry, Properties>>
|
|
300
|
-
|
|
301
|
-
getClusterExpansionZoom(feature: Feature<Geometry, Properties> | number): Promise<number>
|
|
302
|
-
/**
|
|
303
|
-
* Returns all the leaves of a cluster with pagination support.
|
|
304
|
-
* @param cluster feature cluster
|
|
305
|
-
* @param limit the number of leaves to return
|
|
306
|
-
* @param offset the amount of points to skip (for pagination)
|
|
307
|
-
*/
|
|
308
|
-
getClusterLeaves: (feature: Feature<Geometry, Properties> | number, limit: number, offset: number ) => Promise<FeatureCollection<Geometry, Properties>>
|
|
309
|
-
/**
|
|
310
|
-
* Returns the children of a cluster (on the next zoom level).
|
|
311
|
-
* @param cluster feature cluster
|
|
312
|
-
*/
|
|
313
|
-
getClusterChildren: (feature: Feature<Geometry, Properties> | number) => Promise<FeatureCollection<Geometry, Properties>>
|
|
314
|
-
}
|
|
315
|
-
class RasterSource extends Component<RasterSourceProps> { }
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Layers
|
|
319
|
-
*/
|
|
320
|
-
class BackgroundLayer extends Component<BackgroundLayerProps> { }
|
|
321
|
-
class CircleLayer extends Component<CircleLayerProps> { }
|
|
322
|
-
class FillExtrusionLayer extends Component<FillExtrusionLayerProps> { }
|
|
323
|
-
class FillLayer extends Component<FillLayerProps> { }
|
|
324
|
-
class LineLayer extends Component<LineLayerProps> { }
|
|
325
|
-
class RasterLayer extends Component<RasterLayerProps> { }
|
|
326
|
-
class SymbolLayer extends Component<SymbolLayerProps> { }
|
|
327
|
-
class HeatmapLayer extends Component<HeatmapLayerProps> { }
|
|
328
|
-
class Images extends Component<ImagesProps> { }
|
|
329
|
-
class ImageSource extends Component<ImageSourceProps> { }
|
|
330
|
-
|
|
331
|
-
class LocationManager extends Component {
|
|
332
|
-
start(displacement?: number): void;
|
|
333
|
-
stop(): void;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Offline
|
|
338
|
-
*/
|
|
339
|
-
class OfflineManager extends Component {
|
|
340
|
-
createPack(
|
|
341
|
-
options: OfflineCreatePackOptions,
|
|
342
|
-
progressListener?: (pack: OfflinePack, status: OfflineProgressStatus) => void,
|
|
343
|
-
errorListener?: (pack: OfflinePack, err: OfflineProgressError) => void
|
|
344
|
-
): Promise<void>;
|
|
345
|
-
deletePack(name: string): Promise<void>;
|
|
346
|
-
invalidatePack(name: string): Promise<void>;
|
|
347
|
-
getPacks(): Promise<Array<OfflinePack>>;
|
|
348
|
-
getPack(name: string): Promise<OfflinePack | undefined>;
|
|
349
|
-
invalidateAmbientCache(): Promise<void>;
|
|
350
|
-
clearAmbientCache(): Promise<void>;
|
|
351
|
-
setMaximumAmbientCacheSize(size: number): Promise<void>;
|
|
352
|
-
resetDatabase(): Promise<void>;
|
|
353
|
-
setTileCountLimit(limit: number): void;
|
|
354
|
-
setProgressEventThrottle(throttleValue: number): void;
|
|
355
|
-
subscribe(
|
|
356
|
-
packName: string,
|
|
357
|
-
progressListener: (pack: OfflinePack, status: object) => void,
|
|
358
|
-
errorListener?: (pack: OfflinePack, err: object) => void
|
|
359
|
-
): void;
|
|
360
|
-
unsubscribe(packName: string): void;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
class SnapshotManager {
|
|
364
|
-
static takeSnap(options: SnapshotOptions): Promise<string>;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
interface OfflineProgressStatus {
|
|
368
|
-
name: string;
|
|
369
|
-
state: number;
|
|
370
|
-
percentage: number;
|
|
371
|
-
completedResourceSize: number;
|
|
372
|
-
completedTileCount: number;
|
|
373
|
-
completedResourceCount: number;
|
|
374
|
-
requiredResourceCount: number;
|
|
375
|
-
completedTileSize: number;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
interface OfflineProgressError {
|
|
379
|
-
message: string;
|
|
380
|
-
name: string;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
interface OfflinePack {
|
|
384
|
-
name: string,
|
|
385
|
-
bounds: [GeoJSON.Position, GeoJSON.Position];
|
|
386
|
-
metadata: any;
|
|
387
|
-
status: () => Promise<OfflinePackStatus>,
|
|
388
|
-
resume: () => Promise<void>,
|
|
389
|
-
pause: () => Promise<void>,
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
interface OfflinePackStatus {
|
|
393
|
-
name: string,
|
|
394
|
-
state: number,
|
|
395
|
-
percentage: number,
|
|
396
|
-
completedResourceCount: number,
|
|
397
|
-
completedResourceSize: number,
|
|
398
|
-
completedTileSize: number,
|
|
399
|
-
completedTileCount: number,
|
|
400
|
-
requiredResourceCount: number,
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Constants
|
|
405
|
-
*/
|
|
406
|
-
enum UserTrackingModes {
|
|
407
|
-
Follow = 'normal',
|
|
408
|
-
FollowWithHeading = 'compass',
|
|
409
|
-
FollowWithCourse = 'course',
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
enum InterpolationMode {
|
|
413
|
-
Exponential = 0,
|
|
414
|
-
Categorical = 1,
|
|
415
|
-
Interval = 2,
|
|
416
|
-
Identity = 3,
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// TODO: Figure out if these are even supported anymore
|
|
420
|
-
enum StyleURL {
|
|
421
|
-
Street = 'mapbox://styles/mapbox/streets-v11',
|
|
422
|
-
Dark = 'mapbox://styles/mapbox/dark-v10',
|
|
423
|
-
Light = 'mapbox://styles/mapbox/light-v10',
|
|
424
|
-
Outdoors = 'mapbox://styles/mapbox/outdoors-v11',
|
|
425
|
-
Satellite = 'mapbox://styles/mapbox/satellite-v9',
|
|
426
|
-
SatelliteStreet = 'mapbox://styles/mapbox/satellite-streets-v11',
|
|
427
|
-
TrafficDay = 'mapbox://styles/mapbox/navigation-preview-day-v4',
|
|
428
|
-
TrafficNight = 'mapbox://styles/mapbox/navigation-preview-night-v4',
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export type AttributionPosition =
|
|
433
|
-
| { top: number; left: number }
|
|
434
|
-
| { top: number; right: number }
|
|
435
|
-
| { bottom: number; left: number }
|
|
436
|
-
| { bottom: number; right: number };
|
|
437
|
-
|
|
438
|
-
export type LogoPosition =
|
|
439
|
-
| { top: number; left: number }
|
|
440
|
-
| { top: number; right: number }
|
|
441
|
-
| { bottom: number; left: number }
|
|
442
|
-
| { bottom: number; right: number };
|
|
443
|
-
|
|
444
|
-
export interface RegionPayload {
|
|
445
|
-
zoomLevel: number;
|
|
446
|
-
heading: number;
|
|
447
|
-
animated: boolean;
|
|
448
|
-
isUserInteraction: boolean;
|
|
449
|
-
visibleBounds: GeoJSON.Position[];
|
|
450
|
-
pitch: number;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
export interface MapViewProps extends ViewProps {
|
|
454
|
-
animated?: boolean;
|
|
455
|
-
userTrackingMode?: MapLibreGL.UserTrackingModes;
|
|
456
|
-
userLocationVerticalAlignment?: number;
|
|
457
|
-
contentInset?: Array<number>;
|
|
458
|
-
style?: StyleProp<ViewStyle>;
|
|
459
|
-
styleURL?: string;
|
|
460
|
-
styleJSON?: string;
|
|
461
|
-
preferredFramesPerSecond?: number;
|
|
462
|
-
localizeLabels?: boolean;
|
|
463
|
-
zoomEnabled?: boolean;
|
|
464
|
-
scrollEnabled?: boolean;
|
|
465
|
-
pitchEnabled?: boolean;
|
|
466
|
-
rotateEnabled?: boolean;
|
|
467
|
-
attributionEnabled?: boolean;
|
|
468
|
-
attributionPosition?: AttributionPosition;
|
|
469
|
-
logoEnabled?: boolean;
|
|
470
|
-
logoPosition?: LogoPosition;
|
|
471
|
-
compassEnabled?: boolean;
|
|
472
|
-
compassViewPosition?: number;
|
|
473
|
-
compassViewMargins?: Point;
|
|
474
|
-
surfaceView?: boolean;
|
|
475
|
-
regionWillChangeDebounceTime?: number;
|
|
476
|
-
regionDidChangeDebounceTime?: number;
|
|
477
|
-
tintColor?: string;
|
|
478
|
-
|
|
479
|
-
onPress?: (feature: GeoJSON.Feature) => void;
|
|
480
|
-
onLongPress?: (feature: GeoJSON.Feature) => void;
|
|
481
|
-
onRegionWillChange?: (
|
|
482
|
-
feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
|
|
483
|
-
) => void;
|
|
484
|
-
onRegionIsChanging?: (
|
|
485
|
-
feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
|
|
486
|
-
) => void;
|
|
487
|
-
onRegionDidChange?: (
|
|
488
|
-
feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
|
|
489
|
-
) => void;
|
|
490
|
-
onUserLocationUpdate?: (feature: MapLibreGL.Location) => void;
|
|
491
|
-
onWillStartLoadingMap?: () => void;
|
|
492
|
-
onDidFinishLoadingMap?: () => void;
|
|
493
|
-
onDidFailLoadingMap?: () => void;
|
|
494
|
-
onWillStartRenderingFrame?: () => void;
|
|
495
|
-
onDidFinishRenderingFrame?: () => void;
|
|
496
|
-
onDidFinishRenderingFrameFully?: () => void;
|
|
497
|
-
onWillStartRenderingMap?: () => void;
|
|
498
|
-
onDidFinishRenderingMap?: () => void;
|
|
499
|
-
onDidFinishRenderingMapFully?: () => void;
|
|
500
|
-
onDidFinishLoadingStyle?: () => void;
|
|
501
|
-
onUserTrackingModeChange?: () => void;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
export interface CameraProps extends CameraSettings, ViewProps {
|
|
505
|
-
allowUpdates?: boolean;
|
|
506
|
-
animationDuration?: number;
|
|
507
|
-
animationMode?: 'flyTo' | 'easeTo' | 'linearTo' | 'moveTo';
|
|
508
|
-
defaultSettings?: CameraSettings;
|
|
509
|
-
minZoomLevel?: number;
|
|
510
|
-
maxZoomLevel?: number;
|
|
511
|
-
maxBounds?: { ne: [number, number]; sw: [number, number] };
|
|
512
|
-
followUserLocation?: boolean;
|
|
513
|
-
followUserMode?: 'normal' | 'compass' | 'course';
|
|
514
|
-
followZoomLevel?: number;
|
|
515
|
-
followPitch?: number;
|
|
516
|
-
followHeading?: number;
|
|
517
|
-
triggerKey?: any;
|
|
518
|
-
alignment?: number[];
|
|
519
|
-
onUserTrackingModeChange?: (
|
|
520
|
-
event: MapLibreGLEvent<
|
|
521
|
-
'usertrackingmodechange',
|
|
522
|
-
{
|
|
523
|
-
followUserLocation: boolean;
|
|
524
|
-
followUserMode: 'normal' | 'compass' | 'course' | null;
|
|
525
|
-
}
|
|
526
|
-
>,
|
|
527
|
-
) => void;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
export interface CameraPadding {
|
|
531
|
-
paddingLeft?: number;
|
|
532
|
-
paddingRight?: number;
|
|
533
|
-
paddingTop?: number;
|
|
534
|
-
paddingBottom?: number;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
export interface CameraSettings {
|
|
538
|
-
centerCoordinate?: GeoJSON.Position;
|
|
539
|
-
heading?: number;
|
|
540
|
-
pitch?: number;
|
|
541
|
-
padding?: CameraPadding;
|
|
542
|
-
bounds?: CameraPadding & {
|
|
543
|
-
ne: GeoJSON.Position;
|
|
544
|
-
sw: GeoJSON.Position;
|
|
545
|
-
};
|
|
546
|
-
zoomLevel?: number;
|
|
547
|
-
animationDuration?: number;
|
|
548
|
-
animationMode?: 'flyTo' | 'easeTo' | 'linearTo' | 'moveTo';
|
|
549
|
-
stops?: CameraSettings[];
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
export interface UserLocationProps {
|
|
553
|
-
androidRenderMode?: 'normal' | 'compass' | 'gps'
|
|
554
|
-
animated?: boolean;
|
|
555
|
-
children?: ReactNode;
|
|
556
|
-
minDisplacement?: number;
|
|
557
|
-
onPress?: () => void;
|
|
558
|
-
onUpdate?: (location: MapLibreGL.Location) => void;
|
|
559
|
-
renderMode?: 'normal' | 'native';
|
|
560
|
-
showsUserHeadingIndicator?: boolean,
|
|
561
|
-
visible?: boolean;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
export type WithExpression<T> = {
|
|
565
|
-
[P in keyof T]: T[P] | Expression;
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
export interface LightStyle {
|
|
569
|
-
anchor?: Alignment | Expression;
|
|
570
|
-
position?: GeoJSON.Position | Expression;
|
|
571
|
-
positionTransition?: Transition | Expression;
|
|
572
|
-
color?: string | Expression;
|
|
573
|
-
colorTransition?: Transition | Expression;
|
|
574
|
-
intensity?: number | Expression;
|
|
575
|
-
intensityTransition?: Transition | Expression;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
export interface Transition {
|
|
579
|
-
duration: number;
|
|
580
|
-
delay: number;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
export interface BackgroundLayerStyle {
|
|
584
|
-
visibility?: Visibility | Expression;
|
|
585
|
-
backgroundColor?: string | Expression;
|
|
586
|
-
backgroundColorTransition?: Transition | Expression;
|
|
587
|
-
backgroundPattern?: string | Expression;
|
|
588
|
-
backgroundPatternTransition?: Transition | Expression;
|
|
589
|
-
backgroundOpacity?: number | Expression;
|
|
590
|
-
backgroundOpacityTransition?: Transition | Expression;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
export interface CircleLayerStyle {
|
|
594
|
-
visibility?: Visibility | Expression;
|
|
595
|
-
circleRadius?: number | Expression;
|
|
596
|
-
circleRadiusTransition?: Transition | Expression;
|
|
597
|
-
circleColor?: string | Expression;
|
|
598
|
-
circleColorTransition?: Transition | Expression;
|
|
599
|
-
circleBlur?: number | Expression;
|
|
600
|
-
circleBlurTransition?: Transition | Expression;
|
|
601
|
-
circleOpacity?: number | Expression;
|
|
602
|
-
circleOpacityTransition?: Transition | Expression;
|
|
603
|
-
circleTranslate?: Array<number> | Expression;
|
|
604
|
-
circleTranslateTransition?: Transition | Expression;
|
|
605
|
-
circleTranslateAnchor?: Alignment | Expression;
|
|
606
|
-
circlePitchScale?: Alignment | Expression;
|
|
607
|
-
circlePitchAlignment?: Alignment | Expression;
|
|
608
|
-
circleStrokeWidth?: number | Expression;
|
|
609
|
-
circleStrokeWidthTransition?: Transition | Expression;
|
|
610
|
-
circleStrokeColor?: string | Expression;
|
|
611
|
-
circleStrokeColorTransition?: Transition | Expression;
|
|
612
|
-
circleStrokeOpacity?: number | Expression;
|
|
613
|
-
circleStrokeOpacityTransition?: Transition | Expression;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
export interface FillExtrusionLayerStyle {
|
|
617
|
-
visibility?: Visibility | Expression;
|
|
618
|
-
fillExtrusionOpacity?: number | Expression;
|
|
619
|
-
fillExtrusionOpacityTransition?: Transition | Expression;
|
|
620
|
-
fillExtrusionColor?: string | Expression;
|
|
621
|
-
fillExtrusionColorTransition?: Transition | Expression;
|
|
622
|
-
fillExtrusionTranslate?: Array<number> | Expression;
|
|
623
|
-
fillExtrusionTranslateTransition?: Transition | Expression;
|
|
624
|
-
fillExtrusionTranslateAnchor?: Alignment | Expression;
|
|
625
|
-
fillExtrusionPattern?: string | Expression;
|
|
626
|
-
fillExtrusionPatternTransition?: Transition | Expression;
|
|
627
|
-
fillExtrusionHeight?: number | Expression;
|
|
628
|
-
fillExtrusionHeightTransition?: Transition | Expression;
|
|
629
|
-
fillExtrusionBase?: number | Expression;
|
|
630
|
-
fillExtrusionBaseTransition?: Transition | Expression;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
export interface FillLayerStyle {
|
|
634
|
-
visibility?: Visibility | Expression;
|
|
635
|
-
fillAntialias?: boolean | Expression;
|
|
636
|
-
fillOpacity?: number | Expression;
|
|
637
|
-
fillExtrusionOpacityTransition?: Transition | Expression;
|
|
638
|
-
fillColor?: string | Expression;
|
|
639
|
-
fillColorTransition?: Transition | Expression;
|
|
640
|
-
fillOutlineColor?: string | Expression;
|
|
641
|
-
fillOutlineColorTransition?: Transition | Expression;
|
|
642
|
-
fillTranslate?: Array<number> | Expression;
|
|
643
|
-
fillTranslateTransition?: Transition | Expression;
|
|
644
|
-
fillTranslateAnchor?: Alignment | Expression;
|
|
645
|
-
fillPattern?: string | Expression;
|
|
646
|
-
fillPatternTransition?: Transition | Expression;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
export interface LineLayerStyle {
|
|
650
|
-
lineCap?: 'butt' | 'round' | 'square' | Expression;
|
|
651
|
-
lineJoin?: 'bevel' | 'round' | 'miter' | Expression;
|
|
652
|
-
lineMiterLimit?: number | Expression;
|
|
653
|
-
lineRoundLimit?: number | Expression;
|
|
654
|
-
visibility?: Visibility | Expression;
|
|
655
|
-
lineOpacity?: number | Expression;
|
|
656
|
-
lineOpacityTransition?: Transition | Expression;
|
|
657
|
-
lineColor?: string | Expression;
|
|
658
|
-
lineColorTransition?: Transition | Expression;
|
|
659
|
-
lineTranslate?: Array<number> | Expression;
|
|
660
|
-
lineTranslateTransition?: Transition | Expression;
|
|
661
|
-
lineTranslateAnchor?: Alignment | Expression;
|
|
662
|
-
lineWidth?: number | Expression;
|
|
663
|
-
lineWidthTransition?: Transition | Expression;
|
|
664
|
-
lineGapWidth?: number | Expression;
|
|
665
|
-
lineGapWidthTransition?: Transition | Expression;
|
|
666
|
-
lineOffset?: number | Expression;
|
|
667
|
-
lineOffsetTransition?: Transition | Expression;
|
|
668
|
-
lineBlur?: number | Expression;
|
|
669
|
-
lineBlurTransition?: Transition | Expression;
|
|
670
|
-
lineDasharray?: Array<number> | Expression;
|
|
671
|
-
lineDasharrayTransition?: Transition | Expression;
|
|
672
|
-
linePattern?: string | Expression;
|
|
673
|
-
linePatternTransition?: Transition | Expression;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
export interface RasterLayerStyle {
|
|
677
|
-
visibility?: Visibility | Expression;
|
|
678
|
-
rasterOpacity?: number | Expression;
|
|
679
|
-
rasterOpacityTransition?: Transition | Expression;
|
|
680
|
-
rasterHueRotate?: Expression;
|
|
681
|
-
rasterHueRotateTransition?: Transition | Expression;
|
|
682
|
-
rasterBrightnessMin?: number | Expression;
|
|
683
|
-
rasterBrightnessMinTransition?: Transition | Expression;
|
|
684
|
-
rasterBrightnessMax?: number | Expression;
|
|
685
|
-
rasterBrightnessMaxTransition?: Transition | Expression;
|
|
686
|
-
rasterSaturation?: number | Expression;
|
|
687
|
-
rasterSaturationTransition?: Transition | Expression;
|
|
688
|
-
rasterContrast?: number | Expression;
|
|
689
|
-
rasterContrastTransition?: Transition | Expression;
|
|
690
|
-
rasterFadeDuration?: number | Expression;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
export type TextVariableAnchorValues = "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
694
|
-
|
|
695
|
-
export interface SymbolLayerStyle {
|
|
696
|
-
symbolPlacement?: 'point' | 'line' | Expression;
|
|
697
|
-
symbolSpacing?: number | Expression;
|
|
698
|
-
symbolAvoidEdges?: boolean | Expression;
|
|
699
|
-
symbolSortKey?: number | Expression;
|
|
700
|
-
symbolZOrder?: 'auto' | 'viewport-y' | 'source' | Expression;
|
|
701
|
-
iconAllowOverlap?: boolean | Expression;
|
|
702
|
-
iconIgnorePlacement?: boolean | Expression;
|
|
703
|
-
iconOptional?: boolean | Expression;
|
|
704
|
-
iconRotationAlignment?: AutoAlignment | Expression;
|
|
705
|
-
iconSize?: number | Expression;
|
|
706
|
-
iconTextFit?: 'none' | 'width' | 'height' | 'both' | Expression;
|
|
707
|
-
iconTextFitPadding?: Array<number> | Expression;
|
|
708
|
-
iconImage?: string | Expression;
|
|
709
|
-
iconRotate?: number | Expression;
|
|
710
|
-
iconPadding?: number | Expression;
|
|
711
|
-
iconKeepUpright?: boolean | Expression;
|
|
712
|
-
iconOffset?: Array<number> | Expression;
|
|
713
|
-
iconAnchor?: Anchor | Expression;
|
|
714
|
-
iconPitchAlignment?: AutoAlignment | Expression;
|
|
715
|
-
textPitchAlignment?: AutoAlignment | Expression;
|
|
716
|
-
textRotationAlignment?: AutoAlignment | Expression;
|
|
717
|
-
textField?: string | Expression;
|
|
718
|
-
textFont?: Array<string> | Expression;
|
|
719
|
-
textSize?: number | Expression;
|
|
720
|
-
textMaxWidth?: number | Expression;
|
|
721
|
-
textLineHeight?: number | Expression;
|
|
722
|
-
textLetterSpacing?: number | Expression;
|
|
723
|
-
textJustify?: 'left' | 'center' | 'right' | Expression;
|
|
724
|
-
textAnchor?: Anchor | Expression;
|
|
725
|
-
textMaxAngle?: number | Expression;
|
|
726
|
-
textRotate?: number | Expression;
|
|
727
|
-
textPadding?: number | Expression;
|
|
728
|
-
textKeepUpright?: boolean | Expression;
|
|
729
|
-
textTransform?: 'none' | 'uppercase' | 'lowercase' | Expression;
|
|
730
|
-
textOffset?: Array<number> | Expression;
|
|
731
|
-
textAllowOverlap?: boolean | Expression;
|
|
732
|
-
textIgnorePlacement?: boolean | Expression;
|
|
733
|
-
textOptional?: boolean | Expression;
|
|
734
|
-
textVariableAnchor?: Array<TextVariableAnchorValues>;
|
|
735
|
-
textRadialOffset?: number | Expression;
|
|
736
|
-
visibility?: Visibility | Expression;
|
|
737
|
-
iconOpacity?: number | Expression;
|
|
738
|
-
iconOpacityTransition?: Transition | Expression;
|
|
739
|
-
iconColor?: string | Expression;
|
|
740
|
-
iconColorTransition?: Transition | Expression;
|
|
741
|
-
iconHaloColor?: string | Expression;
|
|
742
|
-
iconHaloColorTransition?: Transition | Expression;
|
|
743
|
-
iconHaloWidth?: number | Expression;
|
|
744
|
-
iconHaloWidthTransition?: Transition | Expression;
|
|
745
|
-
iconHaloBlur?: number | Expression;
|
|
746
|
-
iconHaloBlurTransition?: Transition | Expression;
|
|
747
|
-
iconTranslate?: Array<number> | Expression;
|
|
748
|
-
iconTranslateTransition?: Transition | Expression;
|
|
749
|
-
iconTranslateAnchor?: Alignment | Expression;
|
|
750
|
-
textOpacity?: number | Expression;
|
|
751
|
-
textOpacityTransition?: Transition | Expression;
|
|
752
|
-
textColor?: string | Expression;
|
|
753
|
-
textColorTransition?: Transition | Expression;
|
|
754
|
-
textHaloColor?: string | Expression;
|
|
755
|
-
textHaloColorTransition?: Transition | Expression;
|
|
756
|
-
textHaloWidth?: number | Expression;
|
|
757
|
-
textHaloWidthTransition?: Transition | Expression;
|
|
758
|
-
textHaloBlur?: number | Expression;
|
|
759
|
-
textHaloBlurTransition?: Transition | Expression;
|
|
760
|
-
textTranslate?: Array<number> | Expression;
|
|
761
|
-
textTranslateTransition?: Transition | Expression;
|
|
762
|
-
textTranslateAnchor?: Alignment | Expression;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
export interface HeatmapLayerStyle {
|
|
766
|
-
visibility?: Visibility | Expression;
|
|
767
|
-
heatmapRadius?: number | Expression;
|
|
768
|
-
heatmapRadiusTransition?: Transition | Expression;
|
|
769
|
-
heatmapWeight?: number | Expression;
|
|
770
|
-
heatmapIntensity?: number | Expression;
|
|
771
|
-
heatmapIntensityTransition?: Transition | Expression;
|
|
772
|
-
heatmapColor?: string | Expression;
|
|
773
|
-
heatmapOpacity?: number | Expression;
|
|
774
|
-
heatmapOpacityTransition?: Transition | Expression;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
export interface Point {
|
|
778
|
-
x: number;
|
|
779
|
-
y: number;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
export interface LightProps extends Omit<ViewProps, 'style'> {
|
|
783
|
-
style?: LightStyle;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
export interface PointAnnotationProps {
|
|
787
|
-
id: string;
|
|
788
|
-
title?: string;
|
|
789
|
-
snippet?: string;
|
|
790
|
-
selected?: boolean;
|
|
791
|
-
draggable?: boolean;
|
|
792
|
-
coordinate: GeoJSON.Position;
|
|
793
|
-
anchor?: Point;
|
|
794
|
-
onSelected?: () => void;
|
|
795
|
-
onDeselected?: () => void;
|
|
796
|
-
onDragStart?: () => void;
|
|
797
|
-
onDrag?: () => void;
|
|
798
|
-
onDragEnd?: () => void;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
export interface MarkerViewProps extends PointAnnotationProps {
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
export interface StyleProps {
|
|
805
|
-
json: any
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
export interface CalloutProps extends Omit<ViewProps, 'style'> {
|
|
809
|
-
title?: string;
|
|
810
|
-
style?: StyleProp<WithExpression<ViewStyle>>;
|
|
811
|
-
containerStyle?: StyleProp<WithExpression<ViewStyle>>;
|
|
812
|
-
contentStyle?: StyleProp<WithExpression<ViewStyle>>;
|
|
813
|
-
tipStyle?: StyleProp<WithExpression<ViewStyle>>;
|
|
814
|
-
textStyle?: StyleProp<WithExpression<TextStyle>>;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
export interface TileSourceProps extends ViewProps {
|
|
818
|
-
id: string;
|
|
819
|
-
url?: string;
|
|
820
|
-
tileUrlTemplates?: Array<string>;
|
|
821
|
-
minZoomLevel?: number;
|
|
822
|
-
maxZoomLevel?: number;
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
export interface VectorSourceProps extends TileSourceProps {
|
|
826
|
-
onPress?: (event: OnPressEvent) => void;
|
|
827
|
-
hitbox?: {
|
|
828
|
-
width: number;
|
|
829
|
-
height: number;
|
|
830
|
-
};
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
export interface ShapeSourceProps extends ViewProps {
|
|
834
|
-
id: string;
|
|
835
|
-
url?: string;
|
|
836
|
-
shape?: GeoJSON.GeometryCollection | GeoJSON.Feature | GeoJSON.FeatureCollection | GeoJSON.Geometry;
|
|
837
|
-
cluster?: boolean;
|
|
838
|
-
clusterRadius?: number;
|
|
839
|
-
clusterMaxZoomLevel?: number;
|
|
840
|
-
maxZoomLevel?: number;
|
|
841
|
-
buffer?: number;
|
|
842
|
-
tolerance?: number;
|
|
843
|
-
lineMetrics?: boolean;
|
|
844
|
-
images?: { assets?: string[] } & { [key: string]: ImageSourcePropType };
|
|
845
|
-
onPress?: (event: OnPressEvent) => void;
|
|
846
|
-
hitbox?: {
|
|
847
|
-
width: number;
|
|
848
|
-
height: number;
|
|
849
|
-
};
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
export interface RasterSourceProps extends TileSourceProps {
|
|
853
|
-
tileSize?: number;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
export interface LayerBaseProps<T = {}> extends Omit<ViewProps, 'style'> {
|
|
857
|
-
id: string;
|
|
858
|
-
sourceID?: string;
|
|
859
|
-
sourceLayerID?: string;
|
|
860
|
-
aboveLayerID?: string;
|
|
861
|
-
belowLayerID?: string;
|
|
862
|
-
layerIndex?: number;
|
|
863
|
-
filter?: Expression;
|
|
864
|
-
minZoomLevel?: number;
|
|
865
|
-
maxZoomLevel?: number;
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
export interface BackgroundLayerProps extends LayerBaseProps {
|
|
869
|
-
style?: StyleProp<BackgroundLayerStyle>;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
export interface CircleLayerProps extends LayerBaseProps {
|
|
873
|
-
style?: StyleProp<CircleLayerStyle>;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
export interface FillExtrusionLayerProps extends Omit<LayerBaseProps, 'id'> {
|
|
877
|
-
id: string;
|
|
878
|
-
style?: StyleProp<FillExtrusionLayerStyle>;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
export interface FillLayerProps extends LayerBaseProps {
|
|
882
|
-
style?: StyleProp<FillLayerStyle>;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
export interface LineLayerProps extends LayerBaseProps {
|
|
886
|
-
style?: StyleProp<LineLayerStyle>;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
export interface RasterLayerProps extends LayerBaseProps {
|
|
890
|
-
style?: StyleProp<RasterLayerStyle>;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
export interface SymbolLayerProps extends LayerBaseProps {
|
|
894
|
-
style?: StyleProp<SymbolLayerStyle>;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
export interface HeatmapLayerProps extends LayerBaseProps {
|
|
898
|
-
style?: StyleProp<HeatmapLayerStyle>;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
export interface ImagesProps extends ViewProps {
|
|
902
|
-
images?: { assets?: string[] } & { [key: string]: ImageSourcePropType };
|
|
903
|
-
nativeAssetImages?: string[]
|
|
904
|
-
onImageMissing?: (imageKey: string) => void
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
export interface ImageSourceProps extends ViewProps {
|
|
908
|
-
id: string;
|
|
909
|
-
url?: number | string;
|
|
910
|
-
coordinates: [
|
|
911
|
-
GeoJSON.Position,
|
|
912
|
-
GeoJSON.Position,
|
|
913
|
-
GeoJSON.Position,
|
|
914
|
-
GeoJSON.Position,
|
|
915
|
-
];
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
export interface OfflineCreatePackOptions {
|
|
919
|
-
name?: string;
|
|
920
|
-
styleURL?: string;
|
|
921
|
-
bounds?: [GeoJSON.Position, GeoJSON.Position];
|
|
922
|
-
minZoom?: number;
|
|
923
|
-
maxZoom?: number;
|
|
924
|
-
metadata?: any;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
export interface SnapshotOptions {
|
|
928
|
-
centerCoordinate?: GeoJSON.Position;
|
|
929
|
-
width?: number;
|
|
930
|
-
height?: number;
|
|
931
|
-
zoomLevel?: number;
|
|
932
|
-
pitch?: number;
|
|
933
|
-
heading?: number;
|
|
934
|
-
styleURL?: string;
|
|
935
|
-
writeToDisk?: boolean;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
// Logger class
|
|
939
|
-
type LogLevel = "error" | "warning" | "info" | "debug" | "verbose";
|
|
940
|
-
|
|
941
|
-
interface LogObject {
|
|
942
|
-
level: LogLevel;
|
|
943
|
-
message: string;
|
|
944
|
-
tag: string;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
type LogCallback = (object: LogObject) => void;
|
|
948
|
-
|
|
949
|
-
export class Logger {
|
|
950
|
-
public static setLogCallback: (cb: LogCallback) => boolean;
|
|
951
|
-
public static setLogLevel: (level: LogLevel) => void;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
export default MapLibreGL;
|