@maplibre/maplibre-react-native 8.6.0-beta.1 → 9.0.0

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 (75) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +1 -7
  4. package/android/install.md +3 -3
  5. package/android/rctmgl/build.gradle +1 -1
  6. package/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +33 -0
  7. package/app.plugin.js +1 -1
  8. package/docs/Annotation.md +1 -1
  9. package/docs/Annotations.md +3 -8
  10. package/docs/BackgroundLayer.md +2 -2
  11. package/docs/Callout.md +1 -1
  12. package/docs/Camera.md +2 -2
  13. package/docs/CircleLayer.md +31 -14
  14. package/docs/CustomHttpHeaders.md +9 -9
  15. package/docs/FillExtrusionLayer.md +2 -2
  16. package/docs/FillLayer.md +27 -10
  17. package/docs/GettingStarted.md +6 -8
  18. package/docs/HeadingIndicator.md +1 -1
  19. package/docs/HeatmapLayer.md +2 -2
  20. package/docs/ImageSource.md +1 -1
  21. package/docs/Images.md +1 -1
  22. package/docs/Light.md +1 -1
  23. package/docs/LineLayer.md +31 -14
  24. package/docs/{MapboxGL.md → MapLibreGL.md} +5 -5
  25. package/docs/MapView.md +5 -5
  26. package/docs/MarkerView.md +1 -1
  27. package/docs/NativeUserLocation.md +1 -1
  28. package/docs/OfflineManager.md +16 -16
  29. package/docs/PointAnnotation.md +1 -1
  30. package/docs/RasterLayer.md +2 -2
  31. package/docs/RasterSource.md +2 -2
  32. package/docs/ShapeSource.md +2 -2
  33. package/docs/Style.md +3 -3
  34. package/docs/StyleSheet.md +93 -72
  35. package/docs/SymbolLayer.md +17 -13
  36. package/docs/UserLocation.md +2 -2
  37. package/docs/VectorSource.md +2 -2
  38. package/docs/docs.json +102 -46
  39. package/docs/snapshotManager.md +7 -7
  40. package/index.d.ts +8 -7
  41. package/ios/RCTMGL/RCTMGLStyle.h +3 -0
  42. package/ios/RCTMGL/RCTMGLStyle.m +23 -2
  43. package/ios/RCTMGL/index.d.ts +24 -5
  44. package/ios/install.md +12 -4
  45. package/javascript/components/BackgroundLayer.js +2 -2
  46. package/javascript/components/Camera.js +6 -6
  47. package/javascript/components/CircleLayer.js +2 -2
  48. package/javascript/components/FillExtrusionLayer.js +2 -2
  49. package/javascript/components/FillLayer.js +2 -2
  50. package/javascript/components/HeatmapLayer.js +2 -2
  51. package/javascript/components/LineLayer.js +2 -2
  52. package/javascript/components/MapView.js +38 -41
  53. package/javascript/components/RasterLayer.js +2 -2
  54. package/javascript/components/RasterSource.js +2 -2
  55. package/javascript/components/ShapeSource.js +2 -2
  56. package/javascript/components/Style.js +3 -3
  57. package/javascript/components/SymbolLayer.js +2 -2
  58. package/javascript/components/UserLocation.js +2 -0
  59. package/javascript/components/VectorSource.js +2 -2
  60. package/javascript/index.js +38 -42
  61. package/javascript/modules/location/locationManager.js +8 -8
  62. package/javascript/modules/offline/OfflinePack.js +4 -4
  63. package/javascript/modules/offline/offlineManager.js +34 -34
  64. package/javascript/modules/snapshot/SnapshotOptions.js +2 -2
  65. package/javascript/modules/snapshot/snapshotManager.js +8 -8
  66. package/javascript/utils/styleMap.js +37 -6
  67. package/maplibre-react-native.podspec +1 -1
  68. package/package.json +5 -5
  69. package/plugin/build/{withMapbox.d.ts → withMapLibre.d.ts} +1 -1
  70. package/plugin/build/{withMapbox.js → withMapLibre.js} +7 -7
  71. package/plugin/install.md +1 -1
  72. package/scripts/download-style-spec.sh +2 -2
  73. package/scripts/templates/component.md.ejs +1 -1
  74. package/scripts/templates/styleMap.js.ejs +1 -1
  75. package/style-spec/v8.json +266 -43
package/docs/MapView.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <!-- This file was autogenerated from MapView.js do not modify -->
2
- ## <MapboxGL.MapView />
3
- ### MapView backed by Mapbox Native GL
2
+ ## <MapLibreGL.MapView />
3
+ ### MapView backed by MapLibre GL Native
4
4
 
5
5
  ### props
6
6
  | Prop | Type | Default | Required | Description |
7
7
  | ---- | :--: | :-----: | :------: | :----------: |
8
8
  | contentInset | `union` | `none` | `false` | The distance from the edges of the map view’s frame to the edges of the map view’s logical viewport. |
9
9
  | style | `any` | `none` | `false` | Style for wrapping React Native View |
10
- | styleURL | `string` | `none` | `false` | Style URL for map - notice, if non is set it _will_ default to `MapboxGL.StyleURL.Street` |
10
+ | styleURL | `string` | `none` | `false` | Style URL for map - notice, if non is set it _will_ default to `MapLibreGL.StyleURL.Street` |
11
11
  | styleJSON | `string` | `none` | `false` | StyleJSON for map - according to TileJSON specs: https://github.com/mapbox/tilejson-spec |
12
12
  | preferredFramesPerSecond | `number` | `none` | `false` | iOS: The preferred frame rate at which the map view is rendered.<br/>The default value for this property is MGLMapViewPreferredFramesPerSecondDefault,<br/>which will adaptively set the preferred frame rate based on the capability of<br/>the user’s device to maintain a smooth experience. This property can be set to arbitrary integer values.<br/><br/>Android: The maximum frame rate at which the map view is rendered, but it can't excess the ability of device hardware.<br/>This property can be set to arbitrary integer values. |
13
13
  | localizeLabels | `bool` | `false` | `false` | Automatically change the language of the map labels to the system’s preferred language,<br/>this is not something that can be toggled on/off |
@@ -15,10 +15,10 @@
15
15
  | scrollEnabled | `bool` | `true` | `false` | Enable/Disable scroll on the map |
16
16
  | pitchEnabled | `bool` | `true` | `false` | Enable/Disable pitch on map |
17
17
  | rotateEnabled | `bool` | `true` | `false` | Enable/Disable rotation on map |
18
- | attributionEnabled | `bool` | `true` | `false` | The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles,<br/>[requires](https://www.mapbox.com/help/how-attribution-works/) these copyright notices to accompany any map that features Mapbox-designed styles, OpenStreetMap data, or other Mapbox data such as satellite or terrain data.<br/>If that applies to this map view, do not hide this view or remove any notices from it.<br/><br/>If this view is hidden, you must implement this setting elsewhere in your app. See our website for [Android](https://www.mapbox.com/android-docs/map-sdk/overview/#telemetry-opt-out) and [iOS](https://www.mapbox.com/ios-sdk/#telemetry_opt_out) for implementation details.<br/><br/>Enable/Disable attribution on map. |
18
+ | attributionEnabled | `bool` | `true` | `false` | Enable/Disable attribution on map.<br/><br/>This must be enabled for Mapbox-hosted tiles and styles. Please refer to the Mapbox Terms of Service.<br/>Other providers do not require this. |
19
19
  | attributionPosition | `union` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map |
20
20
  | tintColor | `union` | `none` | `false` | MapView's tintColor |
21
- | logoEnabled | `bool` | `true` | `false` | Enable/Disable the logo on the map. |
21
+ | logoEnabled | `bool` | `false` | `false` | Enable/Disable the logo on the map. |
22
22
  | logoPosition | `union` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map |
23
23
  | compassEnabled | `bool` | `none` | `false` | Enable/Disable the compass from appearing on the map |
24
24
  | compassViewPosition | `number` | `none` | `false` | Change corner of map the compass starts at. 0: TopLeft, 1: TopRight, 2: BottomLeft, 3: BottomRight |
@@ -1,5 +1,5 @@
1
1
  <!-- This file was autogenerated from MarkerView.js do not modify -->
2
- ## <MapboxGL.MarkerView />
2
+ ## <MapLibreGL.MarkerView />
3
3
  ### MarkerView allows you to place a interactive react native marker to the map.<br/><br/>If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance<br/>.<br/>This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android<br/>and PointAnnotation on iOS.
4
4
 
5
5
  ### props
@@ -1,5 +1,5 @@
1
1
  <!-- This file was autogenerated from NativeUserLocation.js do not modify -->
2
- ## <MapboxGL.NativeUserLocation />
2
+ ## <MapLibreGL.NativeUserLocation />
3
3
  ###
4
4
 
5
5
  ### props
@@ -1,5 +1,5 @@
1
1
  <!-- This file was autogenerated from offlineManager.js do not modify -->
2
- ## <MapboxGL.offlineManager />
2
+ ## <MapLibreGL.offlineManager />
3
3
  ### OfflineManager implements a singleton (shared object) that manages offline packs.<br/>All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database.<br/>The shared object maintains a canonical collection of offline packs.
4
4
 
5
5
 
@@ -21,7 +21,7 @@ Creates and registers an offline pack that downloads the resources needed to use
21
21
  const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);
22
22
  const errorListener = (offlineRegion, err) => console.log(offlineRegion, err);
23
23
 
24
- await MapboxGL.offlineManager.createPack({
24
+ await MapLibreGL.offlineManager.createPack({
25
25
  name: 'offlinePack',
26
26
  styleURL: 'mapbox://...',
27
27
  minZoom: 14,
@@ -43,7 +43,7 @@ Invalidates the specified offline pack. This method checks that the tiles in the
43
43
 
44
44
 
45
45
  ```javascript
46
- await MapboxGL.offlineManager.invalidatePack('packName')
46
+ await MapLibreGL.offlineManager.invalidatePack('packName')
47
47
  ```
48
48
 
49
49
 
@@ -59,7 +59,7 @@ Unregisters the given offline pack and allows resources that are no longer requi
59
59
 
60
60
 
61
61
  ```javascript
62
- await MapboxGL.offlineManager.deletePack('packName')
62
+ await MapLibreGL.offlineManager.deletePack('packName')
63
63
  ```
64
64
 
65
65
 
@@ -75,7 +75,7 @@ Forces a revalidation of the tiles in the ambient cache and downloads a fresh ve
75
75
 
76
76
 
77
77
  ```javascript
78
- await MapboxGL.offlineManager.invalidateAmbientCache();
78
+ await MapLibreGL.offlineManager.invalidateAmbientCache();
79
79
  ```
80
80
 
81
81
 
@@ -91,7 +91,7 @@ Erases resources from the ambient cache.<br/>This method clears the cache and de
91
91
 
92
92
 
93
93
  ```javascript
94
- await MapboxGL.offlineManager.clearAmbientCache();
94
+ await MapLibreGL.offlineManager.clearAmbientCache();
95
95
  ```
96
96
 
97
97
 
@@ -107,7 +107,7 @@ Sets the maximum size of the ambient cache in bytes. Disables the ambient cache
107
107
 
108
108
 
109
109
  ```javascript
110
- await MapboxGL.offlineManager.setMaximumAmbientCacheSize(5000000);
110
+ await MapLibreGL.offlineManager.setMaximumAmbientCacheSize(5000000);
111
111
  ```
112
112
 
113
113
 
@@ -123,7 +123,7 @@ Deletes the existing database, which includes both the ambient cache and offline
123
123
 
124
124
 
125
125
  ```javascript
126
- await MapboxGL.offlineManager.resetDatabase();
126
+ await MapLibreGL.offlineManager.resetDatabase();
127
127
  ```
128
128
 
129
129
 
@@ -139,7 +139,7 @@ Retrieves all the current offline packs that are stored in the database.
139
139
 
140
140
 
141
141
  ```javascript
142
- const offlinePacks = await MapboxGL.offlineManager.getPacks();
142
+ const offlinePacks = await MapLibreGL.offlineManager.getPacks();
143
143
  ```
144
144
 
145
145
 
@@ -155,7 +155,7 @@ Retrieves an offline pack that is stored in the database by name.
155
155
 
156
156
 
157
157
  ```javascript
158
- const offlinePack = await MapboxGL.offlineManager.getPack();
158
+ const offlinePack = await MapLibreGL.offlineManager.getPack();
159
159
  ```
160
160
 
161
161
 
@@ -171,13 +171,13 @@ Sideloads offline db
171
171
 
172
172
 
173
173
  ```javascript
174
- await MapboxGL.offlineManager.mergeOfflineRegions(path);
174
+ await MapLibreGL.offlineManager.mergeOfflineRegions(path);
175
175
  ```
176
176
 
177
177
 
178
178
  #### setTileCountLimit(limit)
179
179
 
180
- Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device.<br/>The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox.
180
+ Sets the maximum number of tiles that may be downloaded and stored on the current device.<br/>Consult the Terms of Service for your map tile host before changing this value.
181
181
 
182
182
  ##### arguments
183
183
  | Name | Type | Required | Description |
@@ -187,7 +187,7 @@ Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored
187
187
 
188
188
 
189
189
  ```javascript
190
- MapboxGL.offlineManager.setTileCountLimit(1000);
190
+ MapLibreGL.offlineManager.setTileCountLimit(1000);
191
191
  ```
192
192
 
193
193
 
@@ -203,7 +203,7 @@ Sets the period at which download status events will be sent over the React Nati
203
203
 
204
204
 
205
205
  ```javascript
206
- MapboxGL.offlineManager.setProgressEventThrottle(500);
206
+ MapLibreGL.offlineManager.setProgressEventThrottle(500);
207
207
  ```
208
208
 
209
209
 
@@ -223,7 +223,7 @@ Subscribe to download status/error events for the requested offline pack.<br/>No
223
223
  ```javascript
224
224
  const progressListener = (offlinePack, status) => console.log(offlinePack, status)
225
225
  const errorListener = (offlinePack, err) => console.log(offlinePack, err)
226
- MapboxGL.offlineManager.subscribe('packName', progressListener, errorListener)
226
+ MapLibreGL.offlineManager.subscribe('packName', progressListener, errorListener)
227
227
  ```
228
228
 
229
229
 
@@ -239,7 +239,7 @@ Unsubscribes any listeners associated with the offline pack.<br/>It's a good ide
239
239
 
240
240
 
241
241
  ```javascript
242
- MapboxGL.offlineManager.unsubscribe('packName')
242
+ MapLibreGL.offlineManager.unsubscribe('packName')
243
243
  ```
244
244
 
245
245
 
@@ -1,5 +1,5 @@
1
1
  <!-- This file was autogenerated from PointAnnotation.js do not modify -->
2
- ## <MapboxGL.PointAnnotation />
2
+ ## <MapLibreGL.PointAnnotation />
3
3
  ### PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.<br/><br/>Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,<br/>they'll offer much better performance<br/><br/>.<br/>If you need interctive views please use MarkerView,<br/>as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
4
4
 
5
5
  ### props
@@ -1,12 +1,12 @@
1
1
  <!-- This file was autogenerated from RasterLayer.js do not modify -->
2
- ## <MapboxGL.RasterLayer />
2
+ ## <MapLibreGL.RasterLayer />
3
3
  ###
4
4
 
5
5
  ### props
6
6
  | Prop | Type | Default | Required | Description |
7
7
  | ---- | :--: | :-----: | :------: | :----------: |
8
8
  | id | `string` | `none` | `true` | A string that uniquely identifies the source in the style to which it is added. |
9
- | sourceID | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | The source from which to obtain the data to style.<br/>If the source has not yet been added to the current style, the behavior is undefined.<br/>Inferred from parent source only if the layer is a direct child to it. |
9
+ | sourceID | `string` | `MapLibreGL.StyleSource.DefaultSourceID` | `false` | The source from which to obtain the data to style.<br/>If the source has not yet been added to the current style, the behavior is undefined.<br/>Inferred from parent source only if the layer is a direct child to it. |
10
10
  | sourceLayerID | `string` | `none` | `false` | Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. |
11
11
  | aboveLayerID | `string` | `none` | `false` | Inserts a layer above aboveLayerID. |
12
12
  | belowLayerID | `string` | `none` | `false` | Inserts a layer below belowLayerID |
@@ -1,11 +1,11 @@
1
1
  <!-- This file was autogenerated from RasterSource.js do not modify -->
2
- ## <MapboxGL.RasterSource />
2
+ ## <MapLibreGL.RasterSource />
3
3
  ### RasterSource is a map content source that supplies raster image tiles to be shown on the map.<br/>The location of and metadata about the tiles are defined either by an option dictionary<br/>or by an external file that conforms to the TileJSON specification.
4
4
 
5
5
  ### props
6
6
  | Prop | Type | Default | Required | Description |
7
7
  | ---- | :--: | :-----: | :------: | :----------: |
8
- | id | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. |
8
+ | id | `string` | `MapLibreGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. |
9
9
  | url | `string` | `none` | `false` | A URL to a TileJSON configuration file describing the source’s contents and other metadata. |
10
10
  | tileUrlTemplates | `array` | `none` | `false` | An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.<br/>Example: https://example.com/raster-tiles/{z}/{x}/{y}.png |
11
11
  | minZoomLevel | `number` | `none` | `false` | An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.<br/>The value should be between 0 and 22, inclusive, and less than<br/>maxZoomLevel, if specified. The default value for this option is 0. |
@@ -1,11 +1,11 @@
1
1
  <!-- This file was autogenerated from ShapeSource.js do not modify -->
2
- ## <MapboxGL.ShapeSource />
2
+ ## <MapLibreGL.ShapeSource />
3
3
  ### ShapeSource is a map content source that supplies vector shapes to be shown on the map.<br/>The shape may be a url or a GeoJSON object
4
4
 
5
5
  ### props
6
6
  | Prop | Type | Default | Required | Description |
7
7
  | ---- | :--: | :-----: | :------: | :----------: |
8
- | id | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. |
8
+ | id | `string` | `MapLibreGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. |
9
9
  | url | `string` | `none` | `false` | An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle. |
10
10
  | shape | `object` | `none` | `false` | The contents of the source. A shape can represent a GeoJSON geometry, a feature, or a feature colllection. |
11
11
  | cluster | `bool` | `none` | `false` | Enables clustering on the source for point shapes. |
package/docs/Style.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file was autogenerated from Style.js do not modify -->
2
- ## <MapboxGL.Style />
3
- ### Style is a component that automatically adds sources / layers to the map using Mapbox GL Style Spec.<br/>Only [`sources`](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources) & [`layers`](https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/) are supported.<br/>Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/maplibre/maplibre-react-native/tree/main/docs.<br/><br/>TODO: Maintainer forking this project does not understand the above comment regarding what is supported.
2
+ ## <MapLibreGL.Style />
3
+ ### Style is a component that automatically adds sources / layers to the map using MapLibre Style Spec.<br/>Only [`sources`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) & [`layers`](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/) are supported.<br/>Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/maplibre/maplibre-react-native/tree/main/docs.<br/><br/>TODO: Maintainer forking this project does not understand the above comment regarding what is supported.
4
4
 
5
5
  ### props
6
6
  | Prop | Type | Default | Required | Description |
7
7
  | ---- | :--: | :-----: | :------: | :----------: |
8
- | json | `any` | `none` | `false` | A JSON object conforming to the schema described in the Mapbox Style Specification , or a URL to such JSON. |
8
+ | json | `any` | `none` | `false` | A JSON object conforming to the schema described in the MapLibre Style Specification, or a URL to such JSON. |
9
9
 
10
10
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  ### Stylesheet is now a JS object, see [CHANGELOG.md](../CHANGELOG.md) for more details
5
5
 
6
- See (Mapbox expression specs)[https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions] for reference on expressions.
6
+ See (MapLibre expression specs)[https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/] for reference on expressions.
7
7
 
8
8
  ### Style functions
9
9
 
@@ -35,20 +35,21 @@ new:
35
35
  ```
36
36
 
37
37
  old:
38
+
38
39
  ```js
39
40
  // color would change based on zoom level keys.
40
- MapboxGL.StyleSheet.camera({
41
+ MapLibreGL.StyleSheet.camera({
41
42
  0: 'blue',
42
43
  10: 'green',
43
44
  20: 'yellow',
44
- }, MapboxGL.InterpolationMode.Exponential);
45
+ }, MapLibreGL.InterpolationMode.Exponential);
45
46
 
46
47
  // Example of use inside stylesheet
47
- MapboxGL.StyleSheet.create({
48
- fillColor: MapboxGL.StyleSheet.camera({
48
+ MapLibreGL.StyleSheet.create({
49
+ fillColor: MapLibreGL.StyleSheet.camera({
49
50
  15: 'blue',
50
51
  20: 'green',
51
- }, MapboxGL.InterpolationMode.Interval),
52
+ }, MapLibreGL.InterpolationMode.Interval),
52
53
  });
53
54
  ```
54
55
 
@@ -85,25 +86,26 @@ new:
85
86
 
86
87
 
87
88
  old:
89
+
88
90
  ```js
89
91
  // would color the layer based the property rating=[1, 5]
90
- MapboxGL.StyleSheet.source([
92
+ MapLibreGL.StyleSheet.source([
91
93
  [1, 'red'],
92
94
  [2, 'orange'],
93
95
  [3, 'yellow'],
94
96
  [4, 'yellowgreen'],
95
97
  [5, 'green'],
96
- ], 'rating', MapboxGL.InterpolationMode.Categorical);
98
+ ], 'rating', MapLibreGL.InterpolationMode.Categorical);
97
99
 
98
100
  // Example of use inside stylesheet
99
- MapboxGL.StyleSheet.create({
100
- circleColor: MapboxGL.StyleSheet.source([
101
+ MapLibreGL.StyleSheet.create({
102
+ circleColor: MapLibreGL.StyleSheet.source([
101
103
  [1, 'red'],
102
104
  [2, 'orange'],
103
105
  [3, 'yellow'],
104
106
  [4, 'yellowgreen'],
105
107
  [5, 'green'],
106
- ], 'rating', MapboxGL.InterpolationMode.Categorical),
108
+ ], 'rating', MapLibreGL.InterpolationMode.Categorical),
107
109
  });
108
110
  ```
109
111
 
@@ -152,23 +154,24 @@ new:
152
154
 
153
155
 
154
156
  old:
157
+
155
158
  ```js
156
159
  // would change based on the zoom level and rating value
157
160
  // {zoom_level}: [{value}, {style_value}]
158
- MapboxGL.StyleSheet.composite({
161
+ MapLibreGL.StyleSheet.composite({
159
162
  0: [0, 0],
160
163
  0: [5, 5],
161
164
  20: [0, 0],
162
165
  20: [5, 20],
163
- }, 'rating', MapboxGL.InterpolationMode.Interval);
166
+ }, 'rating', MapLibreGL.InterpolationMode.Interval);
164
167
 
165
- MapboxGL.StyleSheet.create({
166
- circleRadius: MapboxGL.StyleSheet.composite({
168
+ MapLibreGL.StyleSheet.create({
169
+ circleRadius: MapLibreGL.StyleSheet.composite({
167
170
  0: [0, 0],
168
171
  0: [5, 5],
169
172
  20: [0, 0],
170
173
  20: [5, 20],
171
- }, 'rating', MapboxGL.InterpolationMode.Interval),
174
+ }, 'rating', MapLibreGL.InterpolationMode.Interval),
172
175
  });
173
176
  ```
174
177
 
@@ -188,8 +191,8 @@ new:
188
191
  old:
189
192
 
190
193
  ```js
191
- MapboxGL.StyleSheet.create({
192
- fillExtrusionHeight: MapboxGL.StyleSheet.identity('height'),
194
+ MapLibreGL.StyleSheet.create({
195
+ fillExtrusionHeight: MapLibreGL.StyleSheet.identity('height'),
193
196
  });
194
197
  ```
195
198
 
@@ -210,8 +213,8 @@ const styles = {
210
213
 
211
214
  ...
212
215
 
213
- <MapboxGL.FillLayer ... style={styles.buildings} />
214
- <MapboxGL.FillLayer ... style={styles.street} />
216
+ <MapLibreGL.FillLayer ... style={styles.buildings} />
217
+ <MapLibreGL.FillLayer ... style={styles.street} />
215
218
  ```
216
219
 
217
220
  ```js
@@ -259,68 +262,82 @@ const layerStyles = {
259
262
 
260
263
  ...
261
264
 
262
- <MapboxGL.SymbolLayer
265
+ <MapLibreGL.SymbolLayer
263
266
  id='pointCount'
264
267
  style={layerStyles.clusterCount} />
265
268
 
266
- <MapboxGL.CircleLayer
269
+ <MapLibreGL.CircleLayer
267
270
  id='clusteredPoints'
268
271
  belowLayerID='pointCount'
269
272
  filter={['has', 'point_count']}
270
273
  style={layerStyles.clusteredPoints} />
271
274
 
272
- <MapboxGL.CircleLayer
275
+ <MapLibreGL.CircleLayer
273
276
  id='singlePoint'
274
277
  filter={['!has', 'point_count']}
275
278
  style={layerStyles.singlePoint} />
276
279
  ```
277
280
 
278
281
  ```javascript
279
- const layerStyles = MapboxGL.StyleSheet.create({
280
- building: {
281
- fillExtrusionOpacity: 1,
282
- fillExtrusionHeight: ['get', 'height'],
283
- fillExtrusionBase: ['get', 'min_height'],
284
- fillExtrusionColor: [
285
- 'interpolate',
286
- ['exponential', 1.5],
287
- ['get', 'height'],
288
- [0, 'white'],
289
- [50, 'blue'],
290
- [100, 'red'],
291
- ],
282
+ const layerStyles = MapLibreGL.StyleSheet.create({
283
+ building: {
284
+ fillExtrusionOpacity: 1,
285
+ fillExtrusionHeight: ['get', 'height'],
286
+ fillExtrusionBase: ['get', 'min_height'],
287
+ fillExtrusionColor: [
288
+ 'interpolate',
289
+ ['exponential', 1.5],
290
+ ['get', 'height'],
291
+ [0, 'white'],
292
+ [50, 'blue'],
293
+ [100, 'red'],
294
+ ],
292
295
  },
293
296
  fillExtrusionColorTransition: { duration: 2000, delay: 0 },
294
297
  },
295
- streets: {
296
- lineColor: 'blue',
297
- lineWidth: 2,
298
- lineOpacity: 0.50,
299
- lineJoin: MapboxGL.LineJoin.Round,
300
- lineCap: MapboxGL.LineCap.Round,
301
- lineDasharray: [2, 2],
302
- },
303
- });
298
+ streets
299
+ :
300
+ {
301
+ lineColor: 'blue',
302
+ lineWidth
303
+ :
304
+ 2,
305
+ lineOpacity
306
+ :
307
+ 0.50,
308
+ lineJoin
309
+ :
310
+ MapLibreGL.LineJoin.Round,
311
+ lineCap
312
+ :
313
+ MapLibreGL.LineCap.Round,
314
+ lineDasharray
315
+ :
316
+ [2, 2],
317
+ }
318
+ ,
319
+ })
320
+ ;
304
321
 
305
322
  ...
306
323
 
307
- <MapboxGL.FillExtrusionLayer
324
+ <MapLibreGL.FillExtrusionLayer
308
325
  id='building3d'
309
326
  sourceLayerID='building'
310
- style={layerStyles.building} />
327
+ style={layerStyles.building}/>
311
328
 
312
- <MapboxGL.LineLayer
329
+ <MapLibreGL.LineLayer
313
330
  id='streetLineColor'
314
331
  sourceLayerID='road'
315
332
  minZoomLevel={14}
316
333
  belowLayerID='building3d'
317
- style={layerStyles.streets} />
334
+ style={layerStyles.streets}/>
318
335
  ```
319
336
 
320
337
  #### old:
321
338
 
322
339
  ```js
323
- const styles = MapboxGL.StyleSheet.create({
340
+ const styles = MapLibreGL.StyleSheet.create({
324
341
  buildings: {
325
342
  fillColor: 'blue',
326
343
  },
@@ -331,12 +348,16 @@ const styles = MapboxGL.StyleSheet.create({
331
348
 
332
349
  ...
333
350
 
334
- <MapboxGL.FillLayer ... style={styles.buildings} />
335
- <MapboxGL.FillLayer ... style={styles.street} />
351
+ <MapLibreGL.FillLayer ...
352
+ style = { styles.buildings }
353
+ />
354
+ <MapLibreGL.FillLayer ...
355
+ style = { styles.street }
356
+ />
336
357
  ```
337
358
 
338
359
  ```js
339
- const layerStyles = MapboxGL.StyleSheet.create({
360
+ const layerStyles = MapLibreGL.StyleSheet.create({
340
361
  singlePoint: {
341
362
  circleColor: 'green',
342
363
  circleOpacity: 0.84,
@@ -346,20 +367,20 @@ const layerStyles = MapboxGL.StyleSheet.create({
346
367
  },
347
368
 
348
369
  clusteredPoints: {
349
- circleColor: MapboxGL.StyleSheet.source([
370
+ circleColor: MapLibreGL.StyleSheet.source([
350
371
  [25, 'yellow'],
351
372
  [50, 'red'],
352
373
  [75, 'blue'],
353
374
  [100, 'orange'],
354
375
  [300, 'pink'],
355
376
  [750, 'white'],
356
- ], 'point_count', MapboxGL.InterpolationMode.Exponential),
377
+ ], 'point_count', MapLibreGL.InterpolationMode.Exponential),
357
378
 
358
- circleRadius: MapboxGL.StyleSheet.source([
379
+ circleRadius: MapLibreGL.StyleSheet.source([
359
380
  [0, 15],
360
381
  [100, 20],
361
382
  [750, 30],
362
- ], 'point_count', MapboxGL.InterpolationMode.Exponential),
383
+ ], 'point_count', MapLibreGL.InterpolationMode.Exponential),
363
384
 
364
385
  circleOpacity: 0.84,
365
386
  circleStrokeWidth: 2,
@@ -374,53 +395,53 @@ const layerStyles = MapboxGL.StyleSheet.create({
374
395
 
375
396
  ...
376
397
 
377
- <MapboxGL.SymbolLayer
398
+ <MapLibreGL.SymbolLayer
378
399
  id='pointCount'
379
- style={layerStyles.clusterCount} />
400
+ style={layerStyles.clusterCount}/>
380
401
 
381
- <MapboxGL.CircleLayer
402
+ <MapLibreGL.CircleLayer
382
403
  id='clusteredPoints'
383
404
  belowLayerID='pointCount'
384
405
  filter={['has', 'point_count']}
385
- style={layerStyles.clusteredPoints} />
406
+ style={layerStyles.clusteredPoints}/>
386
407
 
387
- <MapboxGL.CircleLayer
408
+ <MapLibreGL.CircleLayer
388
409
  id='singlePoint'
389
410
  filter={['!has', 'point_count']}
390
- style={layerStyles.singlePoint} />
411
+ style={layerStyles.singlePoint}/>
391
412
  ```
392
413
 
393
414
  ```javascript
394
- const layerStyles = MapboxGL.StyleSheet.create({
415
+ const layerStyles = MapLibreGL.StyleSheet.create({
395
416
  building: {
396
417
  fillExtrusionOpacity: 1,
397
- fillExtrusionHeight: MapboxGL.StyleSheet.identity('height'),
398
- fillExtrusionBase: MapboxGL.StyleSheet.identity('min_height'),
399
- fillExtrusionColor: MapboxGL.StyleSheet.source([
418
+ fillExtrusionHeight: MapLibreGL.StyleSheet.identity('height'),
419
+ fillExtrusionBase: MapLibreGL.StyleSheet.identity('min_height'),
420
+ fillExtrusionColor: MapLibreGL.StyleSheet.source([
400
421
  [0, 'white'],
401
422
  [50, 'blue'],
402
423
  [100, 'red'],
403
- ], 'height', MapboxGL.InterpolationMode.Exponential),
424
+ ], 'height', MapLibreGL.InterpolationMode.Exponential),
404
425
  fillExtrusionColorTransition: { duration: 2000, delay: 0 },
405
426
  },
406
427
  streets: {
407
428
  lineColor: 'blue',
408
429
  lineWidth: 2,
409
430
  lineOpacity: 0.50,
410
- lineJoin: MapboxGL.LineJoin.Round,
411
- lineCap: MapboxGL.LineCap.Round,
431
+ lineJoin: MapLibreGL.LineJoin.Round,
432
+ lineCap: MapLibreGL.LineCap.Round,
412
433
  lineDasharray: [2, 2],
413
434
  },
414
435
  });
415
436
 
416
437
  ...
417
438
 
418
- <MapboxGL.FillExtrusionLayer
439
+ <MapLibreGL.FillExtrusionLayer
419
440
  id='building3d'
420
441
  sourceLayerID='building'
421
442
  style={layerStyles.building} />
422
443
 
423
- <MapboxGL.LineLayer
444
+ <MapLibreGL.LineLayer
424
445
  id='streetLineColor'
425
446
  sourceLayerID='road'
426
447
  minZoomLevel={14}