@maplibre/maplibre-react-native 10.0.0-alpha.4 → 10.0.0-alpha.6

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 CHANGED
@@ -5,7 +5,17 @@ Please add unreleased changes in the following style:
5
5
  PR Title ([#123](link to my pr))
6
6
  ```
7
7
 
8
+ ## 10.0.0-alpha.6
9
+ fix: [cameraRef?.current?.setCamera causing markerpoint get detached from maps-base](https://github.com/maplibre/maplibre-react-native/issues/409)
10
+ fix: round compass margins and attribution position to nearest integers [android] ([#294](https://github.com/maplibre/maplibre-react-native/pull/294))
11
+
12
+ ## 10.0.0-alpha.5
13
+ Fix: [remove AbortController test mock](https://github.com/maplibre/maplibre-react-native/pull/403)
14
+ Fix: [ExpoPlugin after Class renaming](thttps://github.com/maplibre/maplibre-react-native/pull/405)
15
+ Fix: [android example crashing](https://github.com/maplibre/maplibre-react-native/pull/372) on launch
16
+
8
17
  ## 10.0.0-alpha.4
18
+
9
19
  Update maplibre-native to use [new metal renderer on iOS](https://github.com/maplibre/maplibre-native/releases/tag/ios-v6.4.0)
10
20
 
11
21
  ## 10.0.0-alpha.3
@@ -20,6 +30,7 @@ Fix: Duplicated Signature issue with Xcode 15 ([#238](https://github.com/maplibr
20
30
  Update download-style-spec.sh ([#163](https://github.com/maplibre/maplibre-react-native/pull/163))
21
31
  Update react-maplibre ([#34](https://github.com/maplibre/maplibre-react-native/issues/34))
22
32
  chore: update support libraries ([#121](https://github.com/maplibre/maplibre-react-native/pull/121)).
33
+ fix: correct types in MapView ([#268])(https://github.com/maplibre/maplibre-react-native/pull/268))
23
34
 
24
35
  ## 10.0.0-alpha.1
25
36
 
@@ -56,54 +67,54 @@ fix(iOS): correct import of UIView+React.h header ([#1672](https://github.com/rn
56
67
 
57
68
  ## 8.5.0
58
69
 
59
- build: update install guide and `/example` project for android dependencies ([#1640](https://github.com/rnmapbox/maps/pull/1640))
60
- build(turf): update to version 6.5.0 ([#1638](https://github.com/rnmapbox/maps/pull/1638))
61
- fix(Camera) fix `zoomTo` method and expand Fit example ([#1631](https://github.com/rnmapbox/maps/pull/1631))
62
- ci: two scripts for linting with and without fix ([#1630](https://github.com/rnmapbox/maps/pull/1630))
63
- feat(Camera) add an optional `allowUpdates` boolean prop ([#1619](https://github.com/rnmapbox/maps/pull/1619))
64
- refactor(example): remove unused modules and scripts ([#1618](https://github.com/rnmapbox/maps/pull/1618))
65
- fix(react-native): update api to get rid of EventEmitter warnings ([#1615](https://github.com/rnmapbox/maps/pull/1615))
66
- fix(Camera) persist zoom when changing from `bounds` to `centerCoordinate`, fix zero padding not causing map to update, create unified example showcasing bounds/centerCoordinate/zoom/padding ([#1614](https://github.com/rnmapbox/maps/pull/1614))
67
- Update MapLibre to 5.12.1 on iOS ([#1596](https://github.com/rnmapbox/maps/pull/1596))
70
+ build: update install guide and `/example` project for android dependencies ([#1640](https://github.com/rnmapbox/maps/pull/1640))
71
+ build(turf): update to version 6.5.0 ([#1638](https://github.com/rnmapbox/maps/pull/1638))
72
+ fix(Camera) fix `zoomTo` method and expand Fit example ([#1631](https://github.com/rnmapbox/maps/pull/1631))
73
+ ci: two scripts for linting with and without fix ([#1630](https://github.com/rnmapbox/maps/pull/1630))
74
+ feat(Camera) add an optional `allowUpdates` boolean prop ([#1619](https://github.com/rnmapbox/maps/pull/1619))
75
+ refactor(example): remove unused modules and scripts ([#1618](https://github.com/rnmapbox/maps/pull/1618))
76
+ fix(react-native): update api to get rid of EventEmitter warnings ([#1615](https://github.com/rnmapbox/maps/pull/1615))
77
+ fix(Camera) persist zoom when changing from `bounds` to `centerCoordinate`, fix zero padding not causing map to update, create unified example showcasing bounds/centerCoordinate/zoom/padding ([#1614](https://github.com/rnmapbox/maps/pull/1614))
78
+ Update MapLibre to 5.12.1 on iOS ([#1596](https://github.com/rnmapbox/maps/pull/1596))
68
79
  Update ShapeSource methods to make it usable with any cluster ( Use cluster itself instead of cluster_id as first argument for getClusterExpansionZoom/getClusterLeaves/getClusterChildren methods. Version < 9 methods still supports passing cluster_id as a first argument but a deprecation warning will be shown. ) ([#1499](https://github.com/rnmapbox/maps/pull/1499))
69
80
 
70
81
  ---
71
82
 
72
83
  ## 8.4.0
73
84
 
74
- fix(iOS): pin mapLibre back to `5.12.0` ([#1589](https://github.com/rnmapbox/maps/pull/1589))
75
- chore: improve GH workflows ([#1588](https://github.com/rnmapbox/maps/pull/1588))
76
- build(deps): bump @expo/config-plugins from 3.1.0 to 4.0.3 ([#1585](https://github.com/rnmapbox/maps/pull/1585))
77
- chore(pre-commit): run lint on TS files, change PR template ([#1584](https://github.com/rnmapbox/maps/pull/1584))
78
- feat(example): update vertical alignment example ([#1579](https://github.com/rnmapbox/maps/pull/1579))
79
- fix incorrect anchor calculation for PointAnnotation on iOS ([#1576](https://github.com/rnmapbox/maps/pull/1576))
80
- style(eslint): align root and example with the same configuration ([#1575](https://github.com/rnmapbox/maps/pull/1575))
81
- fix(mapLibre): support version `5.12.0` upwards ([#1571](https://github.com/rnmapbox/maps/pull/1571))
82
- build: upgrade to RN `0.66` ([#1570](https://github.com/rnmapbox/maps/pull/1570))
83
- build(android): add telemetry dependency to default build setup ([#1550](https://github.com/rnmapbox/maps/pull/1550))
84
- feat(camera): Enable `padding` as a root-level prop on the camera, with `bounds.padding*` as fallbacks ([#1538](https://github.com/rnmapbox/maps/pull/1538/files))
85
+ fix(iOS): pin mapLibre back to `5.12.0` ([#1589](https://github.com/rnmapbox/maps/pull/1589))
86
+ chore: improve GH workflows ([#1588](https://github.com/rnmapbox/maps/pull/1588))
87
+ build(deps): bump @expo/config-plugins from 3.1.0 to 4.0.3 ([#1585](https://github.com/rnmapbox/maps/pull/1585))
88
+ chore(pre-commit): run lint on TS files, change PR template ([#1584](https://github.com/rnmapbox/maps/pull/1584))
89
+ feat(example): update vertical alignment example ([#1579](https://github.com/rnmapbox/maps/pull/1579))
90
+ fix incorrect anchor calculation for PointAnnotation on iOS ([#1576](https://github.com/rnmapbox/maps/pull/1576))
91
+ style(eslint): align root and example with the same configuration ([#1575](https://github.com/rnmapbox/maps/pull/1575))
92
+ fix(mapLibre): support version `5.12.0` upwards ([#1571](https://github.com/rnmapbox/maps/pull/1571))
93
+ build: upgrade to RN `0.66` ([#1570](https://github.com/rnmapbox/maps/pull/1570))
94
+ build(android): add telemetry dependency to default build setup ([#1550](https://github.com/rnmapbox/maps/pull/1550))
95
+ feat(camera): Enable `padding` as a root-level prop on the camera, with `bounds.padding*` as fallbacks ([#1538](https://github.com/rnmapbox/maps/pull/1538/files))
85
96
  fix: revert pinned mapLibre version to `5.11.0` ([8a2b00e67ba6398f3f6e6f52e98b0f0cea437e4d](https://github.com/rnmapbox/maps/commit/8a2b00e67ba6398f3f6e6f52e98b0f0cea437e4d))
86
97
 
87
98
  ---
88
99
 
89
100
  ## 8.3.0
90
101
 
91
- Fix TypeScript type for Callout's textStyle prop ([#1450](https://github.com/rnmapbox/maps/pull/1450))
92
- Build(ios): pin maplibre version to 5.12.0 ([#1454](https://github.com/rnmapbox/maps/pull/1454))
93
- Update geoUtils helpers types to correspond with `turf/helpers` ([#1455](https://github.com/rnmapbox/maps/pull/1455))
94
- Fix crash with missing okhttp dependency ([#1452](https://github.com/rnmapbox/maps/pull/1452))
95
- Move from react-native-testing-library => @testing-library/react-native ([#1453](https://github.com/rnmapbox/maps/pull/1453))
96
- Feat(camera): maxBounds/(min|max)ZoomLevel can be updated dynamically ([#1462](https://github.com/rnmapbox/maps/pull/1462))
97
- Refactor(example): clean up folder structure ([#1464](https://github.com/rnmapbox/maps/pull/1464))
98
- Fix lineGradient showing wrong colors ([#1471](https://github.com/rnmapbox/maps/pull/1471))
99
- Support tintColor on Android ([#1465](https://github.com/rnmapbox/maps/pull/1465))
100
- Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/rnmapbox/maps/pull/1469)
101
- Examples: align install steps with yarn, ignore created env files ([#1484](https://github.com/rnmapbox/maps/pull/1484)
102
- Fix(plugin): Exclude arm64 architectures for simulator builds ([#1490](https://github.com/rnmapbox/maps/pull/1490)
103
- Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/rnmapbox/maps/pull/1469))
104
- Docs: make background in example pngs transparent ([#1483](https://github.com/rnmapbox/maps/pull/1483))
105
- Style: run yarn lint ([#1486](https://github.com/rnmapbox/maps/pull/1486))
106
- Test: add unit tests for component light ([#1489](https://github.com/rnmapbox/maps/pull/1489))
102
+ Fix TypeScript type for Callout's textStyle prop ([#1450](https://github.com/rnmapbox/maps/pull/1450))
103
+ Build(ios): pin maplibre version to 5.12.0 ([#1454](https://github.com/rnmapbox/maps/pull/1454))
104
+ Update geoUtils helpers types to correspond with `turf/helpers` ([#1455](https://github.com/rnmapbox/maps/pull/1455))
105
+ Fix crash with missing okhttp dependency ([#1452](https://github.com/rnmapbox/maps/pull/1452))
106
+ Move from react-native-testing-library => @testing-library/react-native ([#1453](https://github.com/rnmapbox/maps/pull/1453))
107
+ Feat(camera): maxBounds/(min|max)ZoomLevel can be updated dynamically ([#1462](https://github.com/rnmapbox/maps/pull/1462))
108
+ Refactor(example): clean up folder structure ([#1464](https://github.com/rnmapbox/maps/pull/1464))
109
+ Fix lineGradient showing wrong colors ([#1471](https://github.com/rnmapbox/maps/pull/1471))
110
+ Support tintColor on Android ([#1465](https://github.com/rnmapbox/maps/pull/1465))
111
+ Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/rnmapbox/maps/pull/1469)
112
+ Examples: align install steps with yarn, ignore created env files ([#1484](https://github.com/rnmapbox/maps/pull/1484)
113
+ Fix(plugin): Exclude arm64 architectures for simulator builds ([#1490](https://github.com/rnmapbox/maps/pull/1490)
114
+ Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/rnmapbox/maps/pull/1469))
115
+ Docs: make background in example pngs transparent ([#1483](https://github.com/rnmapbox/maps/pull/1483))
116
+ Style: run yarn lint ([#1486](https://github.com/rnmapbox/maps/pull/1486))
117
+ Test: add unit tests for component light ([#1489](https://github.com/rnmapbox/maps/pull/1489))
107
118
  Feat: add Adds getClusterChildren method to ShapeSource ([#1495](https://github.com/rnmapbox/maps/pull/1495))
108
119
 
109
120
  ## 8.2.1
@@ -112,22 +123,22 @@ fix issue when publishing to npm with `prepare` script
112
123
 
113
124
  ## 8.2.0
114
125
 
115
- getClusterLeaves method for ShapeSource ([#1411](https://github.com/rnmapbox/maps/pull/1411))
116
- Add logoPosition props to `MapView` to position the mapbox logo ([#1396](https://github.com/rnmapbox/maps/pull/1396))
117
- Add compatibility with React 17/ npm7 ([#1387](https://github.com/rnmapbox/maps/pull/1387))
118
- Add Expo config plugin ([#1388](https://github.com/rnmapbox/maps/pull/1388))
119
- Android: Bump `okhttp` to `4.9.0` ([#1390](https://github.com/rnmapbox/maps/pull/1390))
120
- Support dynamically changing local JSON in styleURL ([#1399](https://github.com/rnmapbox/maps/pull/1399))
121
- Add missing types to `SymbolLayerStyle` & `ImagesProps` ([#1360](https://github.com/rnmapbox/maps/pull/1360))
126
+ getClusterLeaves method for ShapeSource ([#1411](https://github.com/rnmapbox/maps/pull/1411))
127
+ Add logoPosition props to `MapView` to position the mapbox logo ([#1396](https://github.com/rnmapbox/maps/pull/1396))
128
+ Add compatibility with React 17/ npm7 ([#1387](https://github.com/rnmapbox/maps/pull/1387))
129
+ Add Expo config plugin ([#1388](https://github.com/rnmapbox/maps/pull/1388))
130
+ Android: Bump `okhttp` to `4.9.0` ([#1390](https://github.com/rnmapbox/maps/pull/1390))
131
+ Support dynamically changing local JSON in styleURL ([#1399](https://github.com/rnmapbox/maps/pull/1399))
132
+ Add missing types to `SymbolLayerStyle` & `ImagesProps` ([#1360](https://github.com/rnmapbox/maps/pull/1360))
122
133
  Fix error while updating coordinates of RCTMGLImageSource ([#1310](https://github.com/rnmapbox/maps/pull/1310))
123
134
 
124
135
  ## 8.2.0-beta2
125
136
 
126
- Add types for `Logger` class ([#1316](https://github.com/rnmapbox/maps/pull/1316))
127
- Enable linear easing on map camera ([#1281](https://github.com/rnmapbox/maps/pull/1281))
128
- Allow MapLibre as an option ([#1311](https://github.com/rnmapbox/maps/pull/1311))
129
- Fix native UserLocation on Android ([#1284](https://github.com/rnmapbox/maps/pull/1284))
130
- Add getClusterExpansionZoom to ShapeSource ([#1279](https://github.com/rnmapbox/maps/pull/1279))
137
+ Add types for `Logger` class ([#1316](https://github.com/rnmapbox/maps/pull/1316))
138
+ Enable linear easing on map camera ([#1281](https://github.com/rnmapbox/maps/pull/1281))
139
+ Allow MapLibre as an option ([#1311](https://github.com/rnmapbox/maps/pull/1311))
140
+ Fix native UserLocation on Android ([#1284](https://github.com/rnmapbox/maps/pull/1284))
141
+ Add getClusterExpansionZoom to ShapeSource ([#1279](https://github.com/rnmapbox/maps/pull/1279))
131
142
  Add type definition for AnimatedPoint ([#1280](https://github.com/rnmapbox/maps/pull/1280))
132
143
 
133
144
  ## 8.2.0-beta1
@@ -54,9 +54,11 @@ public class MarkerViewManager extends com.mapbox.mapboxsdk.plugins.markerview.M
54
54
 
55
55
  public void updateMarkers(){
56
56
 
57
- try {
58
- for( int i = 0; i < markers.size(); i++ ){
59
- markerUpdate.invoke(markers.get(i));
57
+ try {
58
+ if (markerUpdate != null) {
59
+ for( int i = 0; i < markers.size(); i++ ){
60
+ markerUpdate.invoke(markers.get(i));
61
+ }
60
62
  }
61
63
  }
62
64
  catch (IllegalArgumentException e) { System.out.println(e.toString()); }
@@ -925,10 +925,10 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
925
925
  }
926
926
  float density = getDisplayDensity();
927
927
  mAttributionMargin = new int[]{
928
- position.hasKey("left") ? (int) density * position.getInt("left") : 0,
929
- position.hasKey("top") ? (int) density * position.getInt("top") : 0,
930
- position.hasKey("right") ? (int) density * position.getInt("right") : 0,
931
- position.hasKey("bottom") ? (int) density * position.getInt("bottom") : 0
928
+ position.hasKey("left") ? Math.round(density * position.getInt("left")) : 0,
929
+ position.hasKey("top") ? Math.round(density * position.getInt("top")) : 0,
930
+ position.hasKey("right") ? Math.round(density * position.getInt("right")) : 0,
931
+ position.hasKey("bottom") ? Math.round(density * position.getInt("bottom")) : 0
932
932
  };
933
933
  updateUISettings();
934
934
  }
@@ -1181,10 +1181,10 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
1181
1181
  }
1182
1182
 
1183
1183
  if (mCompassViewMargins != null && uiSettings.isCompassEnabled()) {
1184
- int pixelDensity = (int)getResources().getDisplayMetrics().density;
1184
+ float pixelDensity = getResources().getDisplayMetrics().density;
1185
1185
 
1186
- int x = mCompassViewMargins.getInt("x") * pixelDensity;
1187
- int y = mCompassViewMargins.getInt("y") * pixelDensity;
1186
+ int x = Math.round(mCompassViewMargins.getInt("x") * pixelDensity);
1187
+ int y = Math.round(mCompassViewMargins.getInt("y") * pixelDensity);
1188
1188
 
1189
1189
  switch (uiSettings.getCompassGravity()) {
1190
1190
  case Gravity.TOP | Gravity.START:
package/docs/Camera.md CHANGED
@@ -36,7 +36,7 @@ Map camera transitions to fit provided bounds
36
36
  | ---- | :--: | :------: | :----------: |
37
37
  | `northEastCoordinates` | `Array` | `Yes` | North east coordinate of bound |
38
38
  | `southWestCoordinates` | `Array` | `Yes` | South west coordinate of bound |
39
- | `padding` | `Number` | `No` | Camera padding for bound |
39
+ | `padding` | `n/a` | `No` | Padding for the bounds |
40
40
  | `animationDuration` | `Number` | `No` | Duration of camera animation |
41
41
 
42
42
 
package/docs/MapView.md CHANGED
@@ -108,14 +108,14 @@ const visibleBounds = await this._map.getVisibleBounds();
108
108
  ```
109
109
 
110
110
 
111
- #### queryRenderedFeaturesAtPoint(coordinate[, filter][, layerIDs])
111
+ #### queryRenderedFeaturesAtPoint(point[, filter][, layerIDs])
112
112
 
113
113
  Returns an array of rendered map features that intersect with a given point.
114
114
 
115
115
  ##### arguments
116
116
  | Name | Type | Required | Description |
117
117
  | ---- | :--: | :------: | :----------: |
118
- | `coordinate` | `GeoJSON.Position` | `Yes` | A point expressed in the map view’s coordinate system. |
118
+ | `point` | `tuple` | `Yes` | A point expressed in the map view’s coordinate system. |
119
119
  | `filter` | `FilterExpression` | `No` | A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. |
120
120
  | `layerIDs` | `Array` | `No` | A array of layer id's to filter the features by |
121
121
 
package/docs/docs.json CHANGED
@@ -268,7 +268,7 @@
268
268
  "methods": [
269
269
  {
270
270
  "name": "fitBounds",
271
- "docblock": "Map camera transitions to fit provided bounds\n\n@example\nthis.camera.fitBounds([lng, lat], [lng, lat])\nthis.camera.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides\nthis.camera.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)\nthis.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)\n\n@param {Array<Number>} northEastCoordinates - North east coordinate of bound\n@param {Array<Number>} southWestCoordinates - South west coordinate of bound\n@param {Number=} padding - Camera padding for bound\n@param {Number=} animationDuration - Duration of camera animation\n@return {void}",
271
+ "docblock": "Map camera transitions to fit provided bounds\n\n@example\nthis.camera.fitBounds([lng, lat], [lng, lat])\nthis.camera.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides\nthis.camera.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)\nthis.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)\n\n@param {Array<Number>} northEastCoordinates - North east coordinate of bound\n@param {Array<Number>} southWestCoordinates - South west coordinate of bound\n@param {Number|Array<Number>=} padding - Padding for the bounds\n@param {Number=} animationDuration - Duration of camera animation\n@return {void}",
272
272
  "modifiers": [],
273
273
  "params": [
274
274
  {
@@ -289,9 +289,9 @@
289
289
  },
290
290
  {
291
291
  "name": "padding",
292
- "description": "Camera padding for bound",
292
+ "description": "Padding for the bounds",
293
293
  "type": {
294
- "name": "Number"
294
+ "name": null
295
295
  },
296
296
  "optional": true
297
297
  },
@@ -2136,7 +2136,7 @@
2136
2136
  },
2137
2137
  {
2138
2138
  "name": "getVisibleBounds",
2139
- "docblock": "The coordinate bounds(ne, sw) visible in the users’s viewport.\n\n@example\nconst visibleBounds = await this._map.getVisibleBounds();\n\n@return {Array}",
2139
+ "docblock": "The coordinate bounds(ne, sw) visible in the users’s viewport.\n\n@example\nconst visibleBounds = await this._map.getVisibleBounds();\n\n@return {VisibleBounds}",
2140
2140
  "modifiers": [
2141
2141
  "async"
2142
2142
  ],
@@ -2147,10 +2147,19 @@
2147
2147
  "name": "Promise",
2148
2148
  "elements": [
2149
2149
  {
2150
- "name": "Bounds"
2150
+ "name": "tuple",
2151
+ "raw": "[northEast: GeoJSON.Position, southWest: GeoJSON.Position]",
2152
+ "elements": [
2153
+ {
2154
+ "name": "unknown"
2155
+ },
2156
+ {
2157
+ "name": "unknown"
2158
+ }
2159
+ ]
2151
2160
  }
2152
2161
  ],
2153
- "raw": "Promise<Bounds>"
2162
+ "raw": "Promise<VisibleBounds>"
2154
2163
  }
2155
2164
  },
2156
2165
  "description": "The coordinate bounds(ne, sw) visible in the users’s viewport.",
@@ -2160,16 +2169,16 @@
2160
2169
  },
2161
2170
  {
2162
2171
  "name": "queryRenderedFeaturesAtPoint",
2163
- "docblock": "Returns an array of rendered map features that intersect with a given point.\n\n@example\nthis._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n@param {Array<Number>} coordinate - A point expressed in the map view’s coordinate system.\n@param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.\n@param {Array=} layerIDs - A array of layer id's to filter the features by\n@return {GeoJSON.FeatureCollection}",
2172
+ "docblock": "Returns an array of rendered map features that intersect with a given point.\n\n@example\nthis._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n@typedef {number} ScreenPointX\n@typedef {number} ScreenPointY\n@param {[ScreenPointX, ScreenPointY]} point - A point expressed in the map view’s coordinate system.\n@param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.\n@param {Array=} layerIDs - A array of layer id's to filter the features by\n@return {GeoJSON.FeatureCollection}",
2164
2173
  "modifiers": [
2165
2174
  "async"
2166
2175
  ],
2167
2176
  "params": [
2168
2177
  {
2169
- "name": "coordinate",
2178
+ "name": "point",
2170
2179
  "description": "A point expressed in the map view’s coordinate system.",
2171
2180
  "type": {
2172
- "name": "GeoJSON.Position"
2181
+ "name": "tuple"
2173
2182
  },
2174
2183
  "optional": false
2175
2184
  },
@@ -0,0 +1,246 @@
1
+ <!-- This file was autogenerated from offlineManager.js do not modify -->
2
+ ## <MapLibreGL.offlineManager />
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
+
5
+
6
+ ### methods
7
+ #### createPack(options[, progressListener][, errorListener])
8
+
9
+ Creates and registers an offline pack that downloads the resources needed to use the given region offline.
10
+
11
+ ##### arguments
12
+ | Name | Type | Required | Description |
13
+ | ---- | :--: | :------: | :----------: |
14
+ | `options` | `OfflineCreatePackOptions` | `Yes` | Create options for a offline pack that specifices zoom levels, style url, and the region to download. |
15
+ | `progressListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. |
16
+ | `errorListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. |
17
+
18
+
19
+
20
+ ```javascript
21
+ const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);
22
+ const errorListener = (offlineRegion, err) => console.log(offlineRegion, err);
23
+
24
+ await MapLibreGL.offlineManager.createPack({
25
+ name: 'offlinePack',
26
+ styleURL: 'mapbox://...',
27
+ minZoom: 14,
28
+ maxZoom: 20,
29
+ bounds: [[neLng, neLat], [swLng, swLat]]
30
+ }, progressListener, errorListener)
31
+ ```
32
+
33
+
34
+ #### invalidatePack(name)
35
+
36
+ Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated.This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded.
37
+
38
+ ##### arguments
39
+ | Name | Type | Required | Description |
40
+ | ---- | :--: | :------: | :----------: |
41
+ | `name` | `String` | `Yes` | Name of the offline pack. |
42
+
43
+
44
+
45
+ ```javascript
46
+ await MapLibreGL.offlineManager.invalidatePack('packName')
47
+ ```
48
+
49
+
50
+ #### deletePack(name)
51
+
52
+ Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed.
53
+
54
+ ##### arguments
55
+ | Name | Type | Required | Description |
56
+ | ---- | :--: | :------: | :----------: |
57
+ | `name` | `String` | `Yes` | Name of the offline pack. |
58
+
59
+
60
+
61
+ ```javascript
62
+ await MapLibreGL.offlineManager.deletePack('packName')
63
+ ```
64
+
65
+
66
+ #### invalidateAmbientCache()
67
+
68
+ Forces a revalidation of the tiles in the ambient cache and downloads a fresh version of the tiles from the tile server.<br/>This is the recommend method for clearing the cache.<br/>This is the most efficient method because tiles in the ambient cache are re-downloaded to remove outdated data from a device.<br/>It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects.
69
+
70
+ ##### arguments
71
+ | Name | Type | Required | Description |
72
+ | ---- | :--: | :------: | :----------: |
73
+
74
+
75
+
76
+
77
+ ```javascript
78
+ await MapLibreGL.offlineManager.invalidateAmbientCache();
79
+ ```
80
+
81
+
82
+ #### clearAmbientCache()
83
+
84
+ Erases resources from the ambient cache.<br/>This method clears the cache and decreases the amount of space that map resources take up on the device.
85
+
86
+ ##### arguments
87
+ | Name | Type | Required | Description |
88
+ | ---- | :--: | :------: | :----------: |
89
+
90
+
91
+
92
+
93
+ ```javascript
94
+ await MapLibreGL.offlineManager.clearAmbientCache();
95
+ ```
96
+
97
+
98
+ #### setMaximumAmbientCacheSize(size)
99
+
100
+ Sets the maximum size of the ambient cache in bytes. Disables the ambient cache if set to 0.<br/>This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased.
101
+
102
+ ##### arguments
103
+ | Name | Type | Required | Description |
104
+ | ---- | :--: | :------: | :----------: |
105
+ | `size` | `Number` | `Yes` | Size of ambient cache. |
106
+
107
+
108
+
109
+ ```javascript
110
+ await MapLibreGL.offlineManager.setMaximumAmbientCacheSize(5000000);
111
+ ```
112
+
113
+
114
+ #### resetDatabase()
115
+
116
+ Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it.
117
+
118
+ ##### arguments
119
+ | Name | Type | Required | Description |
120
+ | ---- | :--: | :------: | :----------: |
121
+
122
+
123
+
124
+
125
+ ```javascript
126
+ await MapLibreGL.offlineManager.resetDatabase();
127
+ ```
128
+
129
+
130
+ #### getPacks()
131
+
132
+ Retrieves all the current offline packs that are stored in the database.
133
+
134
+ ##### arguments
135
+ | Name | Type | Required | Description |
136
+ | ---- | :--: | :------: | :----------: |
137
+
138
+
139
+
140
+
141
+ ```javascript
142
+ const offlinePacks = await MapLibreGL.offlineManager.getPacks();
143
+ ```
144
+
145
+
146
+ #### getPack(name)
147
+
148
+ Retrieves an offline pack that is stored in the database by name.
149
+
150
+ ##### arguments
151
+ | Name | Type | Required | Description |
152
+ | ---- | :--: | :------: | :----------: |
153
+ | `name` | `String` | `Yes` | Name of the offline pack. |
154
+
155
+
156
+
157
+ ```javascript
158
+ const offlinePack = await MapLibreGL.offlineManager.getPack();
159
+ ```
160
+
161
+
162
+ #### mergeOfflineRegions(path)
163
+
164
+ Sideloads offline db
165
+
166
+ ##### arguments
167
+ | Name | Type | Required | Description |
168
+ | ---- | :--: | :------: | :----------: |
169
+ | `path` | `String` | `Yes` | Path to offline tile db on file system. |
170
+
171
+
172
+
173
+ ```javascript
174
+ await MapLibreGL.offlineManager.mergeOfflineRegions(path);
175
+ ```
176
+
177
+
178
+ #### setTileCountLimit(limit)
179
+
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
+
182
+ ##### arguments
183
+ | Name | Type | Required | Description |
184
+ | ---- | :--: | :------: | :----------: |
185
+ | `limit` | `Number` | `Yes` | Map tile limit count. |
186
+
187
+
188
+
189
+ ```javascript
190
+ MapLibreGL.offlineManager.setTileCountLimit(1000);
191
+ ```
192
+
193
+
194
+ #### setProgressEventThrottle(throttleValue)
195
+
196
+ Sets the period at which download status events will be sent over the React Native bridge.<br/>The default is 500ms.
197
+
198
+ ##### arguments
199
+ | Name | Type | Required | Description |
200
+ | ---- | :--: | :------: | :----------: |
201
+ | `throttleValue` | `Number` | `Yes` | event throttle value in ms. |
202
+
203
+
204
+
205
+ ```javascript
206
+ MapLibreGL.offlineManager.setProgressEventThrottle(500);
207
+ ```
208
+
209
+
210
+ #### subscribe(packName, progressListener, errorListener)
211
+
212
+ Subscribe to download status/error events for the requested offline pack.<br/>Note that createPack calls this internally if listeners are provided.
213
+
214
+ ##### arguments
215
+ | Name | Type | Required | Description |
216
+ | ---- | :--: | :------: | :----------: |
217
+ | `packName` | `String` | `Yes` | Name of the offline pack. |
218
+ | `progressListener` | `Callback` | `Yes` | Callback that listens for status events while downloading the offline resource. |
219
+ | `errorListener` | `Callback` | `Yes` | Callback that listens for status events while downloading the offline resource. |
220
+
221
+
222
+
223
+ ```javascript
224
+ const progressListener = (offlinePack, status) => console.log(offlinePack, status)
225
+ const errorListener = (offlinePack, err) => console.log(offlinePack, err)
226
+ MapLibreGL.offlineManager.subscribe('packName', progressListener, errorListener)
227
+ ```
228
+
229
+
230
+ #### unsubscribe(packName)
231
+
232
+ Unsubscribes any listeners associated with the offline pack.<br/>It's a good idea to call this on componentWillUnmount.
233
+
234
+ ##### arguments
235
+ | Name | Type | Required | Description |
236
+ | ---- | :--: | :------: | :----------: |
237
+ | `packName` | `String` | `Yes` | Name of the offline pack. |
238
+
239
+
240
+
241
+ ```javascript
242
+ MapLibreGL.offlineManager.unsubscribe('packName')
243
+ ```
244
+
245
+
246
+
package/ios/install.md CHANGED
@@ -8,7 +8,7 @@ Add the following to your `ios/Podfile`:
8
8
  ```ruby
9
9
  post_install do |installer|
10
10
  ... other post install hooks
11
- $RNMBGL.post_install(installer)
11
+ $RCTMLN.post_install(installer)
12
12
  end
13
13
  ```
14
14
 
@@ -31,7 +31,6 @@ environments. The map either does not render at all or appears garbled when pann
31
31
  It is best to test on a real device if at all possible at this time
32
32
  until this is fixed upstream. iOS devs can open the workspace in Xcode and run from there.
33
33
 
34
-
35
34
  ## Installing a specific version
36
35
 
37
36
  The current default MapLibre version is `6.4.0`.
@@ -39,7 +38,7 @@ If you want to install a different version, you can override as follows in
39
38
  your `Podfile`:
40
39
 
41
40
  ```ruby
42
- $RNMBGL_Use_SPM = {
41
+ $RCTMLN_Use_SPM = {
43
42
  url: "https://github.com/maplibre/maplibre-gl-native-distribution",
44
43
  requirement: {
45
44
  kind: "upToNextMajorVersion",
@@ -427,15 +427,15 @@ class Camera extends React.Component<CameraProps> {
427
427
  *
428
428
  * @param {Array<Number>} northEastCoordinates - North east coordinate of bound
429
429
  * @param {Array<Number>} southWestCoordinates - South west coordinate of bound
430
- * @param {Number=} padding - Camera padding for bound
430
+ * @param {Number|Array<Number>=} padding - Padding for the bounds
431
431
  * @param {Number=} animationDuration - Duration of camera animation
432
432
  * @return {void}
433
433
  */
434
434
  fitBounds(
435
435
  northEastCoordinates: number[],
436
436
  southWestCoordinates: number[],
437
- padding = 0,
438
- animationDuration = 0.0,
437
+ padding: number | number[] | null | undefined = 0,
438
+ animationDuration: number | null | undefined = 0.0,
439
439
  ): void {
440
440
  const pad = {
441
441
  paddingLeft: 0,
@@ -42,14 +42,11 @@ export interface RegionPayload {
42
42
  heading: number;
43
43
  animated: boolean;
44
44
  isUserInteraction: boolean;
45
- visibleBounds: GeoJSON.Position[];
45
+ visibleBounds: VisibleBounds;
46
46
  pitch: number;
47
47
  }
48
48
 
49
- interface Bounds {
50
- ne: GeoJSON.Position;
51
- sw: GeoJSON.Position;
52
- }
49
+ type VisibleBounds = [northEast: GeoJSON.Position, southWest: GeoJSON.Position];
53
50
 
54
51
  interface MapViewProps extends BaseProps {
55
52
  /**
@@ -274,7 +271,7 @@ export interface MapViewState {
274
271
  isReady: boolean;
275
272
  width: number;
276
273
  height: number;
277
- region: RegionPayload | null;
274
+ region: GeoJSON.Feature<GeoJSON.Point, RegionPayload> | null;
278
275
  isUserInteraction: boolean;
279
276
  }
280
277
 
@@ -444,10 +441,10 @@ class MapView extends NativeBridgeComponent(
444
441
  * @example
445
442
  * const visibleBounds = await this._map.getVisibleBounds();
446
443
  *
447
- * @return {Array}
444
+ * @return {VisibleBounds}
448
445
  */
449
- async getVisibleBounds(): Promise<Bounds> {
450
- const res: {visibleBounds: Bounds} = await this._runNativeCommand(
446
+ async getVisibleBounds(): Promise<VisibleBounds> {
447
+ const res: {visibleBounds: VisibleBounds} = await this._runNativeCommand(
451
448
  'getVisibleBounds',
452
449
  this._nativeRef,
453
450
  );
@@ -460,25 +457,29 @@ class MapView extends NativeBridgeComponent(
460
457
  * @example
461
458
  * this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])
462
459
  *
463
- * @param {Array<Number>} coordinate - A point expressed in the map view’s coordinate system.
460
+ * @typedef {number} ScreenPointX
461
+ * @typedef {number} ScreenPointY
462
+ * @param {[ScreenPointX, ScreenPointY]} point - A point expressed in the map view’s coordinate system.
464
463
  * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
465
464
  * @param {Array=} layerIDs - A array of layer id's to filter the features by
466
465
  * @return {GeoJSON.FeatureCollection}
467
466
  */
468
467
  async queryRenderedFeaturesAtPoint(
469
- coordinate: GeoJSON.Position,
468
+ point: [screenPointX: number, screenPointY: number],
470
469
  filter?: FilterExpression,
471
470
  layerIDs = [],
472
471
  ): Promise<GeoJSON.FeatureCollection> {
473
- if (!coordinate || coordinate.length < 2) {
474
- throw new Error('Must pass in valid coordinate[lng, lat]');
472
+ if (!point || point.length < 2) {
473
+ throw new Error(
474
+ "Must pass in valid point in the map view's cooridnate system[x, y]",
475
+ );
475
476
  }
476
477
 
477
478
  const res: {data: string | GeoJSON.FeatureCollection} =
478
479
  await this._runNativeCommand(
479
480
  'queryRenderedFeaturesAtPoint',
480
481
  this._nativeRef,
481
- [coordinate, getFilter(filter), layerIDs],
482
+ [point, getFilter(filter), layerIDs],
482
483
  );
483
484
 
484
485
  if (isAndroid()) {
@@ -2,9 +2,9 @@ require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
- $RNMBGL = Object.new
5
+ $RCTMLN = Object.new
6
6
 
7
- def $RNMBGL._add_spm_to_target(project, target, url, requirement, product_name)
7
+ def $RCTMLN._add_spm_to_target(project, target, url, requirement, product_name)
8
8
  pkg_class = Xcodeproj::Project::Object::XCRemoteSwiftPackageReference
9
9
  ref_class = Xcodeproj::Project::Object::XCSwiftPackageProductDependency
10
10
  pkg = project.root_object.package_references.find { |p| p.class == pkg_class && p.repositoryURL == url }
@@ -23,7 +23,7 @@ def $RNMBGL._add_spm_to_target(project, target, url, requirement, product_name)
23
23
  end
24
24
  end
25
25
 
26
- def $RNMBGL.post_install(installer)
26
+ def $RCTMLN.post_install(installer)
27
27
  spm_spec = {
28
28
  url: "https://github.com/maplibre/maplibre-gl-native-distribution",
29
29
  requirement: {
@@ -33,8 +33,8 @@ def $RNMBGL.post_install(installer)
33
33
  product_name: "MapLibre"
34
34
  }
35
35
 
36
- if $RNMBGL_SPM_Spec.is_a?(Hash)
37
- spm_spec = $RNMBGL_SPM_Spec
36
+ if $RCTMLN_SPM_Spec.is_a?(Hash)
37
+ spm_spec = $RCTMLN_SPM_Spec
38
38
  end
39
39
  project = installer.pods_project
40
40
  self._add_spm_to_target(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
3
  "description": "A MapLibre GL Native plugin for creating maps in React Native",
4
- "version": "10.0.0-alpha.4",
4
+ "version": "10.0.0-alpha.6",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -81,7 +81,7 @@ function addMapLibreInstallerBlock(src, blockName) {
81
81
  return (0, generateCode_1.mergeContents)({
82
82
  tag: `@maplibre/maplibre-react-native-${blockName}_installer`,
83
83
  src,
84
- newSrc: ` $RNMBGL.${blockName}_install(installer)`,
84
+ newSrc: ` $RCTMLN.${blockName}_install(installer)`,
85
85
  anchor: new RegExp(`${blockName}_install do \\|installer\\|`),
86
86
  offset: 1,
87
87
  comment: '#',
@@ -110,7 +110,7 @@ exports.setExcludedArchitectures = setExcludedArchitectures;
110
110
  const withoutSignatures = config => {
111
111
  const shellScript = `if [ "$XCODE_VERSION_MAJOR" = "1500" ]; then
112
112
  echo "Remove signature files (Xcode 15 workaround)";
113
- rm -rf "$CONFIGURATION_BUILD_DIR/Mapbox.xcframework-ios.signature";
113
+ rm -rf "$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature";
114
114
  fi`;
115
115
  return (0, config_plugins_1.withXcodeProject)(config, async (config) => {
116
116
  const xcodeProject = config.modResults;
package/setup-jest.js CHANGED
@@ -106,9 +106,3 @@ NativeModules.MLNLocationModule = {
106
106
  stop: jest.fn(),
107
107
  pause: jest.fn(),
108
108
  };
109
-
110
- // Mock for global AbortController
111
- global.AbortController = class {
112
- signal = 'test-signal';
113
- abort = jest.fn();
114
- };