@maplibre/maplibre-react-native 8.6.0-beta.2 → 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.
- package/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +1 -3
- package/android/install.md +3 -3
- package/android/rctmgl/build.gradle +1 -1
- package/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +33 -0
- package/app.plugin.js +1 -1
- package/docs/Annotation.md +1 -1
- package/docs/Annotations.md +3 -8
- package/docs/BackgroundLayer.md +2 -2
- package/docs/Callout.md +1 -1
- package/docs/Camera.md +2 -2
- package/docs/CircleLayer.md +31 -14
- package/docs/CustomHttpHeaders.md +9 -9
- package/docs/FillExtrusionLayer.md +2 -2
- package/docs/FillLayer.md +27 -10
- package/docs/GettingStarted.md +4 -6
- package/docs/HeadingIndicator.md +1 -1
- package/docs/HeatmapLayer.md +2 -2
- package/docs/ImageSource.md +1 -1
- package/docs/Images.md +1 -1
- package/docs/Light.md +1 -1
- package/docs/LineLayer.md +31 -14
- package/docs/{MapboxGL.md → MapLibreGL.md} +5 -5
- package/docs/MapView.md +5 -5
- package/docs/MarkerView.md +1 -1
- package/docs/NativeUserLocation.md +1 -1
- package/docs/OfflineManager.md +16 -16
- package/docs/PointAnnotation.md +1 -1
- package/docs/RasterLayer.md +2 -2
- package/docs/RasterSource.md +2 -2
- package/docs/ShapeSource.md +2 -2
- package/docs/Style.md +3 -3
- package/docs/StyleSheet.md +93 -72
- package/docs/SymbolLayer.md +17 -13
- package/docs/UserLocation.md +2 -2
- package/docs/VectorSource.md +2 -2
- package/docs/docs.json +102 -46
- package/docs/snapshotManager.md +7 -7
- package/index.d.ts +8 -7
- package/ios/RCTMGL/RCTMGLStyle.h +3 -0
- package/ios/RCTMGL/RCTMGLStyle.m +23 -2
- package/ios/RCTMGL/index.d.ts +24 -5
- package/ios/install.md +3 -3
- package/javascript/components/BackgroundLayer.js +2 -2
- package/javascript/components/Camera.js +6 -6
- package/javascript/components/CircleLayer.js +2 -2
- package/javascript/components/FillExtrusionLayer.js +2 -2
- package/javascript/components/FillLayer.js +2 -2
- package/javascript/components/HeatmapLayer.js +2 -2
- package/javascript/components/LineLayer.js +2 -2
- package/javascript/components/MapView.js +38 -41
- package/javascript/components/RasterLayer.js +2 -2
- package/javascript/components/RasterSource.js +2 -2
- package/javascript/components/ShapeSource.js +2 -2
- package/javascript/components/Style.js +3 -3
- package/javascript/components/SymbolLayer.js +2 -2
- package/javascript/components/UserLocation.js +2 -0
- package/javascript/components/VectorSource.js +2 -2
- package/javascript/index.js +38 -42
- package/javascript/modules/location/locationManager.js +8 -8
- package/javascript/modules/offline/OfflinePack.js +4 -4
- package/javascript/modules/offline/offlineManager.js +34 -34
- package/javascript/modules/snapshot/SnapshotOptions.js +2 -2
- package/javascript/modules/snapshot/snapshotManager.js +8 -8
- package/javascript/utils/styleMap.js +37 -6
- package/maplibre-react-native.podspec +1 -1
- package/package.json +5 -5
- package/plugin/build/{withMapbox.d.ts → withMapLibre.d.ts} +1 -1
- package/plugin/build/{withMapbox.js → withMapLibre.js} +7 -7
- package/scripts/download-style-spec.sh +2 -2
- package/scripts/templates/component.md.ejs +1 -1
- package/scripts/templates/styleMap.js.ejs +1 -1
- package/style-spec/v8.json +266 -43
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ Please add unreleased changes in the following style:
|
|
|
5
5
|
PR Title ([#123](link to my pr))
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
+
## 9.0.0
|
|
9
|
+
|
|
10
|
+
Completed fork from RNMapbox, removed support for the proprietary Mapbox SDK, and updated to the latest
|
|
11
|
+
MapLibre GL Native SDKs for iOS and Android.
|
|
12
|
+
|
|
13
|
+
Breaking changes: Mapbox-specific names have been renamed to MapLibre.
|
|
14
|
+
|
|
8
15
|
## 8.6.0-beta.0
|
|
9
16
|
|
|
10
17
|
fix: add TypeScript type for MapViews's preferredFramesPerSecond prop ([#1717](https://github.com/rnmapbox/maps/pull/1717))
|
package/CONTRIBUTING.md
CHANGED
|
@@ -48,7 +48,7 @@ can mitigate some of the pain with this.
|
|
|
48
48
|
Documentation is generated from code blocks and comments.
|
|
49
49
|
It will be auto-generated when you commit changes.
|
|
50
50
|
If any changes are generated from your edits, the changed files will need to be added using `git add` before attempting the commit again.
|
|
51
|
-
To manually generate the changes, run `
|
|
51
|
+
To manually generate the changes, run `yarn generate`.
|
|
52
52
|
|
|
53
53
|
Notice, that changing the documentation in the individual <COMPONENT>.md within `/docs` will not suffice.
|
|
54
54
|
The correct way is the above described
|
package/README.md
CHANGED
|
@@ -13,8 +13,6 @@ React Native Library for building maps with the Mapbox iOS and Android mobile SD
|
|
|
13
13
|
supported both Mapbox and MapLibre for some time, but as the MapLibre and Mapbox SDKs have
|
|
14
14
|
diverged, it has become necessary to separate the projects into specific wrappers by underlying renderer.
|
|
15
15
|
|
|
16
|
-
**This project is in the process of being onboarded and prepared for broad use by the MapLibre community. PRs and tickets welcomed.** Track the status over at: https://github.com/maplibre/maplibre/issues/134
|
|
17
|
-
|
|
18
16
|
---
|
|
19
17
|
|
|
20
18
|
[](https://badge.fury.io/js/%40maplibre%2Fmaplibre-react-native)
|
|
@@ -74,7 +72,7 @@ diverged, it has become necessary to separate the projects into specific wrapper
|
|
|
74
72
|
|
|
75
73
|
### Misc
|
|
76
74
|
|
|
77
|
-
- [
|
|
75
|
+
- [MapLibreGL](/docs/MapLibreGL.md)
|
|
78
76
|
- [CustomHttpHeaders](/docs/CustomHttpHeaders.md)
|
|
79
77
|
- [Logger](/docs/Logger.md)
|
|
80
78
|
|
package/android/install.md
CHANGED
|
@@ -9,7 +9,7 @@ you have to have a line like this in your code before using the SDK.
|
|
|
9
9
|
You can put this near the top of your `App.js` for convenience.
|
|
10
10
|
|
|
11
11
|
```javascript
|
|
12
|
-
|
|
12
|
+
MapLibreGL.setAccessToken(null);
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Setting connection status
|
|
@@ -25,7 +25,7 @@ Manually sets the connectivity state of the app, bypassing any checks to the
|
|
|
25
25
|
and `null` for the normal `ConnectivityManager` behavior.
|
|
26
26
|
|
|
27
27
|
```js
|
|
28
|
-
import
|
|
28
|
+
import MapLibreGL from "@maplibre/maplibre-react-native";
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
MapLibreGL.setConnected(true);
|
|
31
31
|
```
|
|
@@ -35,7 +35,7 @@ dependencies {
|
|
|
35
35
|
implementation "com.facebook.react:react-native:+"
|
|
36
36
|
|
|
37
37
|
// MapLibre SDK
|
|
38
|
-
implementation "org.maplibre.gl:android-sdk:9.
|
|
38
|
+
implementation "org.maplibre.gl:android-sdk:9.6.0"
|
|
39
39
|
implementation "org.maplibre.gl:android-sdk-turf:5.9.0"
|
|
40
40
|
|
|
41
41
|
// Dependencies
|
package/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java
CHANGED
|
@@ -36,6 +36,9 @@ public class RCTMGLStyleFactory {
|
|
|
36
36
|
final RCTMGLStyleValue styleValue = style.getStyleValueForKey(styleKey);
|
|
37
37
|
|
|
38
38
|
switch (styleKey) {
|
|
39
|
+
case "fillSortKey":
|
|
40
|
+
RCTMGLStyleFactory.setFillSortKey(layer, styleValue);
|
|
41
|
+
break;
|
|
39
42
|
case "visibility":
|
|
40
43
|
RCTMGLStyleFactory.setVisibility(layer, styleValue);
|
|
41
44
|
break;
|
|
@@ -106,6 +109,9 @@ public class RCTMGLStyleFactory {
|
|
|
106
109
|
case "lineRoundLimit":
|
|
107
110
|
RCTMGLStyleFactory.setLineRoundLimit(layer, styleValue);
|
|
108
111
|
break;
|
|
112
|
+
case "lineSortKey":
|
|
113
|
+
RCTMGLStyleFactory.setLineSortKey(layer, styleValue);
|
|
114
|
+
break;
|
|
109
115
|
case "visibility":
|
|
110
116
|
RCTMGLStyleFactory.setVisibility(layer, styleValue);
|
|
111
117
|
break;
|
|
@@ -411,6 +417,9 @@ public class RCTMGLStyleFactory {
|
|
|
411
417
|
final RCTMGLStyleValue styleValue = style.getStyleValueForKey(styleKey);
|
|
412
418
|
|
|
413
419
|
switch (styleKey) {
|
|
420
|
+
case "circleSortKey":
|
|
421
|
+
RCTMGLStyleFactory.setCircleSortKey(layer, styleValue);
|
|
422
|
+
break;
|
|
414
423
|
case "visibility":
|
|
415
424
|
RCTMGLStyleFactory.setVisibility(layer, styleValue);
|
|
416
425
|
break;
|
|
@@ -758,6 +767,14 @@ public class RCTMGLStyleFactory {
|
|
|
758
767
|
}
|
|
759
768
|
}
|
|
760
769
|
|
|
770
|
+
public static void setFillSortKey(FillLayer layer, RCTMGLStyleValue styleValue) {
|
|
771
|
+
if (styleValue.isExpression()) {
|
|
772
|
+
layer.setProperties(PropertyFactory.fillSortKey(styleValue.getExpression()));
|
|
773
|
+
} else {
|
|
774
|
+
layer.setProperties(PropertyFactory.fillSortKey(styleValue.getFloat(VALUE_KEY)));
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
761
778
|
public static void setVisibility(FillLayer layer, RCTMGLStyleValue styleValue) {
|
|
762
779
|
layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)));
|
|
763
780
|
}
|
|
@@ -894,6 +911,14 @@ public class RCTMGLStyleFactory {
|
|
|
894
911
|
}
|
|
895
912
|
}
|
|
896
913
|
|
|
914
|
+
public static void setLineSortKey(LineLayer layer, RCTMGLStyleValue styleValue) {
|
|
915
|
+
if (styleValue.isExpression()) {
|
|
916
|
+
layer.setProperties(PropertyFactory.lineSortKey(styleValue.getExpression()));
|
|
917
|
+
} else {
|
|
918
|
+
layer.setProperties(PropertyFactory.lineSortKey(styleValue.getFloat(VALUE_KEY)));
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
|
|
897
922
|
public static void setVisibility(LineLayer layer, RCTMGLStyleValue styleValue) {
|
|
898
923
|
layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)));
|
|
899
924
|
}
|
|
@@ -1606,6 +1631,14 @@ public class RCTMGLStyleFactory {
|
|
|
1606
1631
|
}
|
|
1607
1632
|
}
|
|
1608
1633
|
|
|
1634
|
+
public static void setCircleSortKey(CircleLayer layer, RCTMGLStyleValue styleValue) {
|
|
1635
|
+
if (styleValue.isExpression()) {
|
|
1636
|
+
layer.setProperties(PropertyFactory.circleSortKey(styleValue.getExpression()));
|
|
1637
|
+
} else {
|
|
1638
|
+
layer.setProperties(PropertyFactory.circleSortKey(styleValue.getFloat(VALUE_KEY)));
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1609
1642
|
public static void setVisibility(CircleLayer layer, RCTMGLStyleValue styleValue) {
|
|
1610
1643
|
layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)));
|
|
1611
1644
|
}
|
package/app.plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = require('./plugin/build/
|
|
1
|
+
module.exports = require('./plugin/build/withMapLibre');
|
package/docs/Annotation.md
CHANGED
package/docs/Annotations.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Comparsion of various annotations available in React
|
|
1
|
+
Comparsion of various annotations available in MapLibre React Native:
|
|
2
2
|
|
|
3
3
|
|*Feature* | *SymbolLayer* |*PointAnnotation* |*MarkerView* |*CircleLayer* |
|
|
4
4
|
|-----------------------|--------------------|--------------------------------------|-------------------------|---------------------|
|
|
@@ -8,10 +8,5 @@ Comparsion of various annotations available in React native mapbox:
|
|
|
8
8
|
|Control Z-index | ✓ |iOS: always on top, android: n/a |always on top | ✓ |
|
|
9
9
|
|Clustering | ✓ | | | ✓ |
|
|
10
10
|
|Style with expressions | ✓ | | | ✓ |
|
|
11
|
-
|iOS implementation | [
|
|
12
|
-
|android implementation | [SymbolLayer](https://
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Related links:
|
|
16
|
-
* iOS [markers and annotations](https://docs.mapbox.com/ios/maps/overview/markers-and-annotations/)
|
|
17
|
-
* android [annotation plugin](https://docs.mapbox.com/android/plugins/overview/annotation/)
|
|
11
|
+
|iOS implementation | [MGLSymbolStyleLayer](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLSymbolStyleLayer.html) |[MGLAnnotationView](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLAnnotationView.html) |[MGLAnnotationView](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLAnnotationView.html) |[MGLCircleStyleLayer](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLCircleStyleLayer.html) |
|
|
12
|
+
|android implementation | [SymbolLayer](https://maplibre.org/maplibre-gl-native/android/api/com/mapbox/mapboxsdk/style/layers/SymbolLayer.html)|[annotation.Symbol](https://docs.mapbox.com/android/api/plugins/annotation/0.8.0/com/mapbox/mapboxsdk/plugins/annotation/Symbol.html)|[annotation.Marker](https://docs.mapbox.com/android/api/plugins/markerview/0.4.0/com/mapbox/mapboxsdk/plugins/markerview/MarkerView.html) |[CircleLayer](https://maplibre.org/maplibre-gl-native/android/api/com/mapbox/mapboxsdk/style/layers/CircleLayer.html)|
|
package/docs/BackgroundLayer.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!-- This file was autogenerated from BackgroundLayer.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.BackgroundLayer />
|
|
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` | `
|
|
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 |
|
package/docs/Callout.md
CHANGED
package/docs/Camera.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- This file was autogenerated from Camera.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.Camera />
|
|
3
3
|
###
|
|
4
4
|
|
|
5
5
|
### props
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
| ne | `array` | `none` | `true` | northEastCoordinates - North east coordinate of bound |
|
|
50
50
|
| sw | `array` | `none` | `true` | southWestCoordinates - South west coordinate of bound |
|
|
51
51
|
| followUserLocation | `bool` | `none` | `false` | Should the map orientation follow the user's. |
|
|
52
|
-
| followUserMode | `enum` | `none` | `false` | The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the `
|
|
52
|
+
| followUserMode | `enum` | `none` | `false` | The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the `MapLibreGL.UserTrackingModes` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](../example/src/examples/SetUserTrackingModes.js) |
|
|
53
53
|
| followZoomLevel | `number` | `none` | `false` | The zoomLevel on map while followUserLocation is set to `true` |
|
|
54
54
|
| followPitch | `number` | `none` | `false` | The pitch on map while followUserLocation is set to `true` |
|
|
55
55
|
| followHeading | `number` | `none` | `false` | The heading on map while followUserLocation is set to `true` |
|
package/docs/CircleLayer.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!-- This file was autogenerated from CircleLayer.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.CircleLayer />
|
|
3
3
|
### CircleLayer is a style layer that renders one or more filled circles on the map.
|
|
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` | `
|
|
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<br/>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 |
|
|
@@ -19,18 +19,35 @@
|
|
|
19
19
|
|
|
20
20
|
### styles
|
|
21
21
|
|
|
22
|
-
* <a href="#name">
|
|
23
|
-
* <a href="#name-1">
|
|
24
|
-
* <a href="#name-2">
|
|
25
|
-
* <a href="#name-3">
|
|
26
|
-
* <a href="#name-4">
|
|
27
|
-
* <a href="#name-5">
|
|
28
|
-
* <a href="#name-6">
|
|
29
|
-
* <a href="#name-7">
|
|
30
|
-
* <a href="#name-8">
|
|
31
|
-
* <a href="#name-9">
|
|
32
|
-
* <a href="#name-10">
|
|
33
|
-
* <a href="#name-11">
|
|
22
|
+
* <a href="#name">circleSortKey</a><br/>
|
|
23
|
+
* <a href="#name-1">visibility</a><br/>
|
|
24
|
+
* <a href="#name-2">circleRadius</a><br/>
|
|
25
|
+
* <a href="#name-3">circleColor</a><br/>
|
|
26
|
+
* <a href="#name-4">circleBlur</a><br/>
|
|
27
|
+
* <a href="#name-5">circleOpacity</a><br/>
|
|
28
|
+
* <a href="#name-6">circleTranslate</a><br/>
|
|
29
|
+
* <a href="#name-7">circleTranslateAnchor</a><br/>
|
|
30
|
+
* <a href="#name-8">circlePitchScale</a><br/>
|
|
31
|
+
* <a href="#name-9">circlePitchAlignment</a><br/>
|
|
32
|
+
* <a href="#name-10">circleStrokeWidth</a><br/>
|
|
33
|
+
* <a href="#name-11">circleStrokeColor</a><br/>
|
|
34
|
+
* <a href="#name-12">circleStrokeOpacity</a><br/>
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
#### Name
|
|
39
|
+
`circleSortKey`
|
|
40
|
+
|
|
41
|
+
#### Description
|
|
42
|
+
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
43
|
+
|
|
44
|
+
#### Type
|
|
45
|
+
`number`
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
#### Expression
|
|
49
|
+
|
|
50
|
+
Parameters: `zoom, feature`
|
|
34
51
|
|
|
35
52
|
___
|
|
36
53
|
|
|
@@ -54,31 +54,31 @@ You can add and remove headers at runtime.
|
|
|
54
54
|
#### To add a header
|
|
55
55
|
|
|
56
56
|
```javascript
|
|
57
|
-
|
|
57
|
+
MapLibreGL.addCustomHeader('Authorization', '{auth header}');
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
#### To remove a header
|
|
61
61
|
|
|
62
62
|
```javascript
|
|
63
|
-
|
|
63
|
+
MapLibreGL.removeCustomHeader('Authorization');
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
#### Working example
|
|
67
67
|
|
|
68
68
|
```javascript
|
|
69
69
|
export default class HelloWorldApp extends Component {
|
|
70
|
-
componentDidMount() {
|
|
71
|
-
|
|
70
|
+
componentDidMount () {
|
|
71
|
+
MapLibreGL.addCustomHeader('Authorization', '{auth header}');
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
render() {
|
|
75
|
-
|
|
74
|
+
render () {
|
|
75
|
+
MapLibreGL.addCustomHeader('X-Some-Header', 'my-value');
|
|
76
76
|
return (
|
|
77
77
|
<View style={styles.page}>
|
|
78
78
|
<View style={styles.container}>
|
|
79
|
-
<
|
|
80
|
-
style={styles.map}
|
|
81
|
-
styleURL={STYLE_URL}
|
|
79
|
+
<MapLibreGL.MapView
|
|
80
|
+
style={styles.map}
|
|
81
|
+
styleURL={STYLE_URL}/>
|
|
82
82
|
</View>
|
|
83
83
|
</View>
|
|
84
84
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!-- This file was autogenerated from FillExtrusionLayer.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.FillExtrusionLayer />
|
|
3
3
|
### FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map.
|
|
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` | `
|
|
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 |
|
package/docs/FillLayer.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!-- This file was autogenerated from FillLayer.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.FillLayer />
|
|
3
3
|
### FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map.
|
|
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` | `
|
|
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 |
|
|
@@ -19,14 +19,31 @@
|
|
|
19
19
|
|
|
20
20
|
### styles
|
|
21
21
|
|
|
22
|
-
* <a href="#name">
|
|
23
|
-
* <a href="#name-1">
|
|
24
|
-
* <a href="#name-2">
|
|
25
|
-
* <a href="#name-3">
|
|
26
|
-
* <a href="#name-4">
|
|
27
|
-
* <a href="#name-5">
|
|
28
|
-
* <a href="#name-6">
|
|
29
|
-
* <a href="#name-7">
|
|
22
|
+
* <a href="#name">fillSortKey</a><br/>
|
|
23
|
+
* <a href="#name-1">visibility</a><br/>
|
|
24
|
+
* <a href="#name-2">fillAntialias</a><br/>
|
|
25
|
+
* <a href="#name-3">fillOpacity</a><br/>
|
|
26
|
+
* <a href="#name-4">fillColor</a><br/>
|
|
27
|
+
* <a href="#name-5">fillOutlineColor</a><br/>
|
|
28
|
+
* <a href="#name-6">fillTranslate</a><br/>
|
|
29
|
+
* <a href="#name-7">fillTranslateAnchor</a><br/>
|
|
30
|
+
* <a href="#name-8">fillPattern</a><br/>
|
|
31
|
+
|
|
32
|
+
___
|
|
33
|
+
|
|
34
|
+
#### Name
|
|
35
|
+
`fillSortKey`
|
|
36
|
+
|
|
37
|
+
#### Description
|
|
38
|
+
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
39
|
+
|
|
40
|
+
#### Type
|
|
41
|
+
`number`
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
#### Expression
|
|
45
|
+
|
|
46
|
+
Parameters: `zoom, feature`
|
|
30
47
|
|
|
31
48
|
___
|
|
32
49
|
|
package/docs/GettingStarted.md
CHANGED
|
@@ -17,7 +17,7 @@ This quickstart guide provides a zero-to-map intro, and from there you can check
|
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### Set up a React Native project
|
|
21
21
|
|
|
22
22
|
If you don't have an existing React Native project, create one:
|
|
23
23
|
|
|
@@ -25,8 +25,6 @@ If you don't have an existing React Native project, create one:
|
|
|
25
25
|
npx react-native init MyApp
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
TODO: See if latest version works
|
|
29
|
-
|
|
30
28
|
### Install Package
|
|
31
29
|
|
|
32
30
|
From your React Native project's root directory, add the package via
|
|
@@ -59,11 +57,11 @@ Here is an example minimal App.js
|
|
|
59
57
|
```js
|
|
60
58
|
import React, {Component} from 'react';
|
|
61
59
|
import {StyleSheet, View} from 'react-native';
|
|
62
|
-
import
|
|
60
|
+
import MapLibreGL from '@maplibre/maplibre-react-native';
|
|
63
61
|
|
|
64
62
|
// Will be null for most users (only Mapbox authenticates this way).
|
|
65
63
|
// Required on Android. See Android installation notes.
|
|
66
|
-
|
|
64
|
+
MapLibreGL.setAccessToken(null);
|
|
67
65
|
|
|
68
66
|
const styles = StyleSheet.create({
|
|
69
67
|
page: {
|
|
@@ -82,7 +80,7 @@ export default class App extends Component {
|
|
|
82
80
|
render() {
|
|
83
81
|
return (
|
|
84
82
|
<View style={styles.page}>
|
|
85
|
-
<
|
|
83
|
+
<MapLibreGL.MapView
|
|
86
84
|
style={styles.map}
|
|
87
85
|
logoEnabled={false}
|
|
88
86
|
styleURL="https://demotiles.maplibre.org/style.json"
|
package/docs/HeadingIndicator.md
CHANGED
package/docs/HeatmapLayer.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!-- This file was autogenerated from HeatmapLayer.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.HeatmapLayer />
|
|
3
3
|
### HeatmapLayer is a style layer that renders one or more filled circles on the map.
|
|
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` | `
|
|
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<br/>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 |
|
package/docs/ImageSource.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- This file was autogenerated from ImageSource.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.ImageSource />
|
|
3
3
|
### ImageSource is a content source that is used for a georeferenced raster image to be shown on the map.<br/>The georeferenced image scales and rotates as the user zooms and rotates the map
|
|
4
4
|
|
|
5
5
|
### props
|
package/docs/Images.md
CHANGED
package/docs/Light.md
CHANGED
package/docs/LineLayer.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!-- This file was autogenerated from LineLayer.js do not modify -->
|
|
2
|
-
## <
|
|
2
|
+
## <MapLibreGL.LineLayer />
|
|
3
3
|
### LineLayer is a style layer that renders one or more stroked polylines on the map.
|
|
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` | `
|
|
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 |
|
|
@@ -23,18 +23,19 @@
|
|
|
23
23
|
* <a href="#name-1">lineJoin</a><br/>
|
|
24
24
|
* <a href="#name-2">lineMiterLimit</a><br/>
|
|
25
25
|
* <a href="#name-3">lineRoundLimit</a><br/>
|
|
26
|
-
* <a href="#name-4">
|
|
27
|
-
* <a href="#name-5">
|
|
28
|
-
* <a href="#name-6">
|
|
29
|
-
* <a href="#name-7">
|
|
30
|
-
* <a href="#name-8">
|
|
31
|
-
* <a href="#name-9">
|
|
32
|
-
* <a href="#name-10">
|
|
33
|
-
* <a href="#name-11">
|
|
34
|
-
* <a href="#name-12">
|
|
35
|
-
* <a href="#name-13">
|
|
36
|
-
* <a href="#name-14">
|
|
37
|
-
* <a href="#name-15">
|
|
26
|
+
* <a href="#name-4">lineSortKey</a><br/>
|
|
27
|
+
* <a href="#name-5">visibility</a><br/>
|
|
28
|
+
* <a href="#name-6">lineOpacity</a><br/>
|
|
29
|
+
* <a href="#name-7">lineColor</a><br/>
|
|
30
|
+
* <a href="#name-8">lineTranslate</a><br/>
|
|
31
|
+
* <a href="#name-9">lineTranslateAnchor</a><br/>
|
|
32
|
+
* <a href="#name-10">lineWidth</a><br/>
|
|
33
|
+
* <a href="#name-11">lineGapWidth</a><br/>
|
|
34
|
+
* <a href="#name-12">lineOffset</a><br/>
|
|
35
|
+
* <a href="#name-13">lineBlur</a><br/>
|
|
36
|
+
* <a href="#name-14">lineDasharray</a><br/>
|
|
37
|
+
* <a href="#name-15">linePattern</a><br/>
|
|
38
|
+
* <a href="#name-16">lineGradient</a><br/>
|
|
38
39
|
|
|
39
40
|
___
|
|
40
41
|
|
|
@@ -122,6 +123,22 @@ Parameters: `zoom`
|
|
|
122
123
|
|
|
123
124
|
___
|
|
124
125
|
|
|
126
|
+
#### Name
|
|
127
|
+
`lineSortKey`
|
|
128
|
+
|
|
129
|
+
#### Description
|
|
130
|
+
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
131
|
+
|
|
132
|
+
#### Type
|
|
133
|
+
`number`
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
#### Expression
|
|
137
|
+
|
|
138
|
+
Parameters: `zoom, feature`
|
|
139
|
+
|
|
140
|
+
___
|
|
141
|
+
|
|
125
142
|
#### Name
|
|
126
143
|
`visibility`
|
|
127
144
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##
|
|
1
|
+
## MapLibreGL
|
|
2
2
|
###
|
|
3
3
|
|
|
4
4
|
### methods
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
##### arguments
|
|
8
8
|
| Name | Type | Required | Description |
|
|
9
9
|
| ---- | :--: | :------: | :----------: |
|
|
10
|
-
| `accessToken` | `String` | `Yes` |
|
|
10
|
+
| `accessToken` | `String` | `Yes` | access token to pull Mapbox-hosted tiles; can be `null` for other tile hosts |
|
|
11
11
|
|
|
12
12
|
##### Description
|
|
13
13
|
sets the accessToken, which is required when you want to use mapbox tiles
|
|
@@ -18,7 +18,7 @@ not required when using other tiles
|
|
|
18
18
|
##### arguments
|
|
19
19
|
| Name | Type | Required | Description |
|
|
20
20
|
| ---- | :--: | :------: | :----------: |
|
|
21
|
-
| `accessToken` | `String` | `Yes` |
|
|
21
|
+
| `accessToken` | `String` | `Yes` | access token to pull Mapbox-hosted tiles; can be `null` if for other tile hosts |
|
|
22
22
|
|
|
23
23
|
##### Description
|
|
24
24
|
gets the accessToken
|
|
@@ -59,7 +59,7 @@ Either permission was granted or denied.
|
|
|
59
59
|
##### arguments
|
|
60
60
|
| Name | Type | Required | Description |
|
|
61
61
|
| ---- | :--: | :------: | :----------: |
|
|
62
|
-
| `connected` | `Boolean` | `Yes` | whether or not
|
|
62
|
+
| `connected` | `Boolean` | `Yes` | whether or not the SDK should assume it is online |
|
|
63
63
|
|
|
64
64
|
#### Description
|
|
65
|
-
If you want to fully block
|
|
65
|
+
If you want to fully block map tile requests over the network, such as for a low-data / offline application.
|
package/docs/MapView.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<!-- This file was autogenerated from MapView.js do not modify -->
|
|
2
|
-
## <
|
|
3
|
-
### MapView backed by
|
|
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 `
|
|
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` |
|
|
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` | `
|
|
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 |
|