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

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,6 +5,11 @@ 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.5
9
+ Fix: [remove AbortController test mock](https://github.com/maplibre/maplibre-react-native/pull/403)
10
+ Fix: [ExpoPlugin after Class renaming](thttps://github.com/maplibre/maplibre-react-native/pull/405)
11
+ Fix: [android example crashing](https://github.com/maplibre/maplibre-react-native/pull/372) on launch
12
+
8
13
  ## 10.0.0-alpha.4
9
14
  Update maplibre-native to use [new metal renderer on iOS](https://github.com/maplibre/maplibre-native/releases/tag/ios-v6.4.0)
10
15
 
@@ -20,6 +25,7 @@ Fix: Duplicated Signature issue with Xcode 15 ([#238](https://github.com/maplibr
20
25
  Update download-style-spec.sh ([#163](https://github.com/maplibre/maplibre-react-native/pull/163))
21
26
  Update react-maplibre ([#34](https://github.com/maplibre/maplibre-react-native/issues/34))
22
27
  chore: update support libraries ([#121](https://github.com/maplibre/maplibre-react-native/pull/121)).
28
+ fix: correct types in MapView ([#268])(https://github.com/maplibre/maplibre-react-native/pull/268))
23
29
 
24
30
  ## 10.0.0-alpha.1
25
31
 
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
@@ -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
  },
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",
@@ -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.5",
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
- };