Skip to content

Commit

Permalink
Merge branch 'beta' into fix/camera
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/examples/src/examples/Map/CreateOfflineRegion.tsx
  • Loading branch information
KiwiKilian committed Dec 9, 2024
2 parents 31bf4cc + a7c3294 commit 869db53
Show file tree
Hide file tree
Showing 40 changed files with 91 additions and 2,454 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-yarn-
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/review-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
./packages/react-native-app/android/.gradle
./packages/react-native-app/android/app/build
./packages/react-native-app/android/build
key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}-${{ hashFiles('android/**') }}
restore-keys: |
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-
- name: Build
if: steps.android-build-cache.outputs.cache-hit != 'true'
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/review-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,23 @@ jobs:
id: cocoapods-cache
with:
path: ./packages/react-native-app/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }}
key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }}
${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-
- name: Install Cocoapods
# New Arch changes Podfile.lock so it always has to run
if: matrix.new-arch || steps.cocoapods-cache.outputs.cache-hit != 'true'
run: RCT_NEW_ARCH_ENABLED=${{ matrix.new-arch && '1' || '0' }} yarn pod:install

- name: Cache Build
uses: actions/cache@v4
id: ios-build-cache
with:
path: ./packages/react-native-app/ios/build
key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}-${{ hashFiles('ios/**') }}
restore-keys: |
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }}
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-
- name: Build
if: steps.ios-build-cache.outputs.cache-hit != 'true'
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# [10.0.0-beta.5](https://github.com/maplibre/maplibre-react-native/compare/v10.0.0-beta.4...v10.0.0-beta.5) (2024-12-08)


### Features

* upgrade Android gradle setup ([#539](https://github.com/maplibre/maplibre-react-native/issues/539)) ([761ae0d](https://github.com/maplibre/maplibre-react-native/commit/761ae0d527169eef663bb61222847e7110fc2221))

# [10.0.0-beta.4](https://github.com/maplibre/maplibre-react-native/compare/v10.0.0-beta.3...v10.0.0-beta.4) (2024-12-08)


### Features

* remove deprecations ([#543](https://github.com/maplibre/maplibre-react-native/issues/543)) ([0c41ada](https://github.com/maplibre/maplibre-react-native/commit/0c41adac7f75b695c3edaabe50f5cef808af268b))


### BREAKING CHANGES

* - Deprecated `UserTrackingModes` is removed in favor of `UserTrackingMode`
- Removed deprecated `setCamera` from `MapView`
- Removed deprecated `byId` methods from `ShapeSource`
- Removed deprecated `children` from `SymbolSource`
- Removed deprecated `assets` key from `Images`
- Removed deprecated event keys

# [10.0.0-beta.3](https://github.com/maplibre/maplibre-react-native/compare/v10.0.0-beta.2...v10.0.0-beta.3) (2024-12-08)


### Features

* export RegionPayload and MapLibreRNEvent types ([#544](https://github.com/maplibre/maplibre-react-native/issues/544)) ([b342f1b](https://github.com/maplibre/maplibre-react-native/commit/b342f1b5c82fe3d8bb1a353ebb33c3df26d47532))
* remove duplicate of `OfflinePackStatus` type ([#542](https://github.com/maplibre/maplibre-react-native/issues/542)) ([9e231b7](https://github.com/maplibre/maplibre-react-native/commit/9e231b79ed5f8d7c03189cd7e2264fb0a2dcf1c9))


### BREAKING CHANGES

* Replace OfflineProgressStatus with OfflinePackStatus

# [10.0.0-beta.2](https://github.com/maplibre/maplibre-react-native/compare/v10.0.0-beta.1...v10.0.0-beta.2) (2024-12-08)


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ diverged, it has become necessary to separate the projects into specific wrapper
<p align="center">
<img src="/docs/assets/device-android.png"
alt="Indoor Building Map Android"
height="480"
height="320"
/>
<img src="/docs/assets/device-ios.png"
alt="Indoor Building Map iOS"
height="480"
height="320"
/>
</p>

Expand Down
1 change: 0 additions & 1 deletion __tests__/interface.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ describe("Public Interface", () => {

// constants
"UserTrackingMode",
"UserTrackingModes", // deprecated
"UserLocationRenderMode",
"StyleURL",
"EventTypes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactAppli
return modules;
}

@Deprecated
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactApplicationContext) {
List<ViewManager> managers = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,70 +243,4 @@ public void getClusterChildren(String callbackID, String featureJSON) {
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
}

// Deprecated. Will be removed in 9+ ver.
public void getClusterExpansionZoomById(String callbackID, int clusterId) {
if (mSource == null) {
WritableMap payload = new WritableNativeMap();
payload.putString("error", "source is not yet loaded");
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
return;
}
List<Feature> features = mSource.querySourceFeatures(Expression.eq(Expression.id(), clusterId));
int zoom = -1;
if (features.size() > 0) {
zoom = mSource.getClusterExpansionZoom(features.get(0));
}

if (zoom == -1) {
WritableMap payload = new WritableNativeMap();
payload.putString("error", "Could not get zoom for cluster id " + clusterId);
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
return;
}

WritableMap payload = new WritableNativeMap();
payload.putInt("data", zoom);

AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
}

// Deprecated. Will be removed in 9+ ver.
public void getClusterLeavesById(String callbackID, int clusterId, int number, int offset) {
if (mSource == null) {
WritableMap payload = new WritableNativeMap();
payload.putString("error", "source is not yet loaded");
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
return;
}
Feature clusterFeature = mSource.querySourceFeatures(Expression.eq(Expression.get("cluster_id"), clusterId)).get(0);
FeatureCollection leaves = mSource.getClusterLeaves(clusterFeature, number, offset);
WritableMap payload = new WritableNativeMap();
payload.putString("data", leaves.toJson());

AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
}

// Deprecated. Will be removed in 9+ ver.
public void getClusterChildrenById(String callbackID, int clusterId) {
if (mSource == null) {
WritableMap payload = new WritableNativeMap();
payload.putString("error", "source is not yet loaded");
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
return;
}
Feature clusterFeature = mSource.querySourceFeatures(Expression.eq(Expression.get("cluster_id"), clusterId)).get(0);
FeatureCollection leaves = mSource.getClusterChildren(clusterFeature);
WritableMap payload = new WritableNativeMap();
payload.putString("data", leaves.toJson());

AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ public Map<String, String> customEvents() {
public static final int METHOD_GET_CLUSTER_LEAVES = 105;
public static final int METHOD_GET_CLUSTER_CHILDREN = 106;

// Deprecated. Will be removed in 9+ ver.
public static final int METHOD_GET_CLUSTER_EXPANSION_ZOOM_BY_ID = 107;
public static final int METHOD_GET_CLUSTER_LEAVES_BY_ID = 108;
public static final int METHOD_GET_CLUSTER_CHILDREN_BY_ID = 109;

@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
Expand All @@ -192,12 +187,6 @@ public Map<String, Integer> getCommandsMap() {
.put("getClusterExpansionZoom", METHOD_GET_CLUSTER_EXPANSION_ZOOM)
.put("getClusterLeaves", METHOD_GET_CLUSTER_LEAVES)
.put("getClusterChildren", METHOD_GET_CLUSTER_CHILDREN)

// Deprecated. Will be removed in 9+ ver.
.put("getClusterExpansionZoomById", METHOD_GET_CLUSTER_EXPANSION_ZOOM_BY_ID)
.put("getClusterLeavesById", METHOD_GET_CLUSTER_LEAVES_BY_ID)
.put("getClusterChildrenById", METHOD_GET_CLUSTER_CHILDREN_BY_ID)

.build();
}

Expand Down Expand Up @@ -227,23 +216,6 @@ public void receiveCommand(MLRNShapeSource source, int commandID, @Nullable Read
args.getString(1)
);
break;
case METHOD_GET_CLUSTER_EXPANSION_ZOOM_BY_ID:
source.getClusterExpansionZoomById(args.getString(0), args.getInt(1));
break;
case METHOD_GET_CLUSTER_LEAVES_BY_ID:
source.getClusterLeavesById(
args.getString(0),
args.getInt(1),
args.getInt(2),
args.getInt((3))
);
break;
case METHOD_GET_CLUSTER_CHILDREN_BY_ID:
source.getClusterChildrenById(
args.getString(0),
args.getInt(1)
);
break;
}
}
}
2 changes: 1 addition & 1 deletion docs/components/Camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| maxZoomLevel | `number` | `none` | `false` | Maximum zoom level of the map |
| maxBounds | `CameraBounds` | `none` | `false` | Restrict map panning so that the center is within these bounds |
| followUserLocation | `boolean` | `none` | `false` | Should the map orientation follow the user's. |
| followUserMode | `UserTrackingMode` | `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](/packages/examples/src/examples/Camera/SetUserTrackingModes.js) |
| followUserMode | `UserTrackingMode` | `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.UserTrackingMode` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](/packages/examples/src/examples/Camera/SetUserTrackingMode.js) |
| followZoomLevel | `number` | `none` | `false` | The zoomLevel on map while followUserLocation is set to `true` |
| followPitch | `number` | `none` | `false` | The pitch on map while followUserLocation is set to `true` |
| followHeading | `number` | `none` | `false` | The heading on map while followUserLocation is set to `true` |
Expand Down
6 changes: 0 additions & 6 deletions docs/components/MapView.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'],
```


### `setCamera()`

Map camera will perform updates based on provided config. Deprecated use Camera#setCamera.



### `takeSnap([writeToDisk])`

Takes snapshot of map with current tiles and returns a URI to the image
Expand Down
1 change: 0 additions & 1 deletion docs/components/SymbolLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SymbolLayer is a style layer that renders icon and text labels at points or alon
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `SymbolLayerStyleProps` | `none` | `false` | Customizable style attributes |
| children | `ReactElement \| ReactElement[]` | `none` | `false` | @deprecated passed children used to create an image with id of symbol in style and also set the iconImageName property accordingly.<br/>This is now deprecated, use Image component instead. |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
22 changes: 1 addition & 21 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
"required": false,
"type": "UserTrackingMode",
"default": "none",
"description": "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](/packages/examples/src/examples/Camera/SetUserTrackingModes.js)"
"description": "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.UserTrackingMode` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](/packages/examples/src/examples/Camera/SetUserTrackingMode.js)"
},
{
"name": "followZoomLevel",
Expand Down Expand Up @@ -2250,19 +2250,6 @@
"\nthis._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n"
]
},
{
"name": "setCamera",
"docblock": "Map camera will perform updates based on provided config. Deprecated use Camera#setCamera.",
"modifiers": [],
"params": [],
"returns": {
"type": {
"name": "void"
}
},
"description": "Map camera will perform updates based on provided config. Deprecated use Camera#setCamera.",
"examples": []
},
{
"name": "takeSnap",
"docblock": "Takes snapshot of map with current tiles and returns a URI to the image\n@param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64\n@return {String}",
Expand Down Expand Up @@ -3397,13 +3384,6 @@
"default": "none",
"description": "Customizable style attributes"
},
{
"name": "children",
"required": false,
"type": "ReactElement \\| ReactElement[]",
"default": "none",
"description": "@deprecated passed children used to create an image with id of symbol in style and also set the iconImageName property accordingly.\nThis is now deprecated, use Image component instead."
},
{
"name": "sourceID",
"required": false,
Expand Down
1 change: 0 additions & 1 deletion ios/MLRN/MLRNBackgroundLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MLRNLayer.h"
@import MapLibre;

@interface MLRNBackgroundLayer : MLRNLayer

Expand Down
1 change: 0 additions & 1 deletion ios/MLRN/MLRNFillExtrusionLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MLRNVectorLayer.h"
@import MapLibre;

@interface MLRNFillExtrusionLayer : MLRNVectorLayer

Expand Down
1 change: 0 additions & 1 deletion ios/MLRN/MLRNFillLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MLRNVectorLayer.h"
@import MapLibre;

@interface MLRNFillLayer : MLRNVectorLayer

Expand Down
1 change: 1 addition & 0 deletions ios/MLRN/MLRNFillLayer.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "MLRNFillLayer.h"
#import "MLRNStyle.h"

#import <React/RCTLog.h>

@implementation MLRNFillLayer
Expand Down
1 change: 0 additions & 1 deletion ios/MLRN/MLRNLineLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MLRNVectorLayer.h"
@import MapLibre;

@interface MLRNLineLayer : MLRNVectorLayer

Expand Down
1 change: 0 additions & 1 deletion ios/MLRN/MLRNRasterLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MLRNLayer.h"
@import MapLibre;

@interface MLRNRasterLayer : MLRNLayer

Expand Down
11 changes: 0 additions & 11 deletions ios/MLRN/MLRNShapeSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,4 @@

- (double)getClusterExpansionZoom:(nonnull NSString *)featureJSON;

// Deprecated. Will be removed in 9+ ver.
- (nonnull NSArray<id <MLNFeature>> *)getClusterLeavesById:(nonnull NSNumber *)clusterId
number:(NSUInteger)number
offset:(NSUInteger)offset;

// Deprecated. Will be removed in 9+ ver.
- (nonnull NSArray<id <MLNFeature>> *)getClusterChildrenById:(nonnull NSNumber *)clusterId;

// Deprecated. Will be removed in 9+ ver.
- (double)getClusterExpansionZoomById:(nonnull NSNumber *)clusterId;

@end
Loading

0 comments on commit 869db53

Please sign in to comment.