Skip to content

Commit

Permalink
Maplibre native 6.4 (#370)
Browse files Browse the repository at this point in the history
* fix product name
* renaming folders rctmgl -> rctmln
* renaming android root rctmgl -> rctmln
* renaming files
* rctmgl -> rctmln
* mgl -> mln
* more renaming
* android fixes
* linter fixes
* updating changelog and package with new version
* fix xcode 15.2 issue
* renaming mapbox folder to maplibre
* rename com.mapbox to com.maplibre
  • Loading branch information
sjchristi authored May 9, 2024
1 parent 69dd282 commit 88b7fa0
Show file tree
Hide file tree
Showing 351 changed files with 4,590 additions and 4,592 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ RNTester/Pods/*

# project specific
ios/Mapbox.framework
ios/Maplibre.framework
ios/temp.zip
ios/.framework_version
ios/Pods/
ios/RCTMGL.xcodeproj/xcshareddata/
ios/RCTMLN.xcodeproj/xcshareddata/
android/build/
android/.gradle/
android/.idea/
Expand Down
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Path to sources
sonar.sources=javascript,android/src,ios/RCTMGL
sonar.sources=javascript,android/src,ios/RCTMLN
#sonar.exclusions=
#sonar.inclusions=

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Please add unreleased changes in the following style:
PR Title ([#123](link to my pr))
```

## 10.0.0-alpha.4
Update maplibre-native to use [new metal renderer on iOS](https://github.com/maplibre/maplibre-native/releases/tag/ios-v6.4.0)

## 10.0.0-alpha.3

Fix: Remove unused import breaking react-native 0.74.0 ([#365](https://github.com/maplibre/maplibre-react-native/pull/365))
Expand Down
4 changes: 2 additions & 2 deletions __tests__/components/BackgroundLayer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('BackgroundLayer', () => {
<BackgroundLayer id="requiredBackgroundLayerID" />,
);

const backgroundLayer = queryByTestId('rctmglBackgroundLayer');
const backgroundLayer = queryByTestId('rctmlnBackgroundLayer');
const {props} = backgroundLayer;

expect(props.sourceID).toStrictEqual('DefaultSourceID');
Expand All @@ -30,7 +30,7 @@ describe('BackgroundLayer', () => {
};

const {queryByTestId} = render(<BackgroundLayer {...testProps} />);
const backgroundLayer = queryByTestId('rctmglBackgroundLayer');
const backgroundLayer = queryByTestId('rctmlnBackgroundLayer');
const {props} = backgroundLayer;

expect(props.id).toStrictEqual(testProps.id);
Expand Down
6 changes: 3 additions & 3 deletions __tests__/components/Callout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Callout', () => {
describe('_renderDefaultCallout', () => {
test('renders default children', () => {
const {UNSAFE_getByType, UNSAFE_getAllByType} = render(<Callout />);
const callout = UNSAFE_getByType('RCTMGLCallout');
const callout = UNSAFE_getByType('RCTMLNCallout');

expect(callout).toBeDefined();
expect(UNSAFE_getAllByType(Text).length).toBe(1);
Expand All @@ -34,7 +34,7 @@ describe('Callout', () => {
<Callout {...testProps} />,
);

const callout = UNSAFE_getByType('RCTMGLCallout');
const callout = UNSAFE_getByType('RCTMLNCallout');
const views = UNSAFE_getAllByType(View);
const text = UNSAFE_getByType(Text);

Expand Down Expand Up @@ -76,7 +76,7 @@ describe('Callout', () => {
<View>{'Foo Bar'}</View>
</Callout>,
);
const callout = UNSAFE_getByType('RCTMGLCallout');
const callout = UNSAFE_getByType('RCTMLNCallout');
const views = UNSAFE_getAllByType(View);

const calloutWrapperTestStyle = callout.props.style[1].width;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/components/CircleLayer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {render} from '@testing-library/react-native';
describe('CircleLayer', () => {
test('renders correctly with default props', () => {
const {queryByTestId} = render(<CircleLayer id="requiredCircleLayerID" />);
const circleLayer = queryByTestId('rctmglCircleLayer');
const circleLayer = queryByTestId('rctmlnCircleLayer');
const {props} = circleLayer;

expect(props.sourceID).toStrictEqual('DefaultSourceID');
Expand All @@ -27,7 +27,7 @@ describe('CircleLayer', () => {
};

const {queryByTestId} = render(<CircleLayer {...customProps} />);
const circleLayer = queryByTestId('rctmglCircleLayer');
const circleLayer = queryByTestId('rctmlnCircleLayer');
const {props} = circleLayer;

expect(props.id).toStrictEqual(customProps.id);
Expand Down
4 changes: 2 additions & 2 deletions __tests__/components/HeatmapLayer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('HeatmapLayer', () => {
const {UNSAFE_getByType} = render(
<HeatmapLayer id="requiredHeatmapLayerID" />,
);
const heatmapLayer = UNSAFE_getByType('RCTMGLHeatmapLayer');
const heatmapLayer = UNSAFE_getByType('RCTMLNHeatmapLayer');
const {props} = heatmapLayer;
expect(props.sourceID).toStrictEqual('DefaultSourceID');
});
Expand All @@ -27,7 +27,7 @@ describe('HeatmapLayer', () => {
style: {visibility: 'none'},
};
const {UNSAFE_getByType} = render(<HeatmapLayer {...testProps} />);
const {props} = UNSAFE_getByType('RCTMGLHeatmapLayer');
const {props} = UNSAFE_getByType('RCTMLNHeatmapLayer');

expect(props.id).toStrictEqual(testProps.id);
expect(props.sourceID).toStrictEqual(testProps.sourceID);
Expand Down
4 changes: 2 additions & 2 deletions __tests__/components/Light.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {render} from '@testing-library/react-native';
describe('Light', () => {
test('renders correctly', () => {
const {queryByTestId} = render(<Light />);
const light = queryByTestId('rctmglLight');
const light = queryByTestId('rctmlnLight');
expect(light).toBeDefined();
});

Expand All @@ -21,7 +21,7 @@ describe('Light', () => {

const {queryByTestId} = render(<Light style={testStyles} />);

const customStyles = queryByTestId('rctmglLight').props.reactStyle;
const customStyles = queryByTestId('rctmlnLight').props.reactStyle;
const {anchor} = customStyles;
const {color} = customStyles;
const {position} = customStyles;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/modules/location/locationManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import LocationManager, {

import {NativeModules} from 'react-native';

const MapLibreGL = NativeModules.MGLModule;
const MapLibreGLLocationManager = NativeModules.MGLLocationModule;
const MapLibreGL = NativeModules.MLNModule;
const MapLibreGLLocationManager = NativeModules.MLNLocationModule;

const location = {
coords: {
Expand Down
6 changes: 3 additions & 3 deletions __tests__/modules/offline/OfflinePack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('OfflinePack', () => {

it('should resume pack download', () => {
const spy = jest.spyOn(
NativeModules.MGLOfflineModule,
NativeModules.MLNOfflineModule,
'resumePackDownload',
);
const offlinePack = new OfflinePack(fakeNativePack);
Expand All @@ -30,15 +30,15 @@ describe('OfflinePack', () => {
});

it('should pause pack download', () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'pausePackDownload');
const spy = jest.spyOn(NativeModules.MLNOfflineModule, 'pausePackDownload');
const offlinePack = new OfflinePack(fakeNativePack);
offlinePack.pause();
expect(spy).toHaveBeenCalled();
spy.mockRestore();
});

it('should get pack status', () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'getPackStatus');
const spy = jest.spyOn(NativeModules.MLNOfflineModule, 'getPackStatus');
const offlinePack = new OfflinePack(fakeNativePack);
offlinePack.status();
expect(spy).toHaveBeenCalled();
Expand Down
10 changes: 5 additions & 5 deletions __tests__/modules/offline/offlineManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('offlineManager', () => {

it('should set max tile count limit', () => {
const expectedLimit = 2000;
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setTileCountLimit');
const spy = jest.spyOn(NativeModules.MLNOfflineModule, 'setTileCountLimit');
MapLibreGL.offlineManager.setTileCountLimit(expectedLimit);
expect(spy).toHaveBeenCalledWith(expectedLimit);
spy.mockRestore();
Expand All @@ -80,7 +80,7 @@ describe('offlineManager', () => {
it('should set progress event throttle value', () => {
const expectedThrottleValue = 500;
const spy = jest.spyOn(
NativeModules.MGLOfflineModule,
NativeModules.MLNOfflineModule,
'setProgressEventThrottle',
);
MapLibreGL.offlineManager.setProgressEventThrottle(expectedThrottleValue);
Expand Down Expand Up @@ -194,7 +194,7 @@ describe('offlineManager', () => {
beforeEach(() => (Platform.OS = 'android'));

it('should set pack observer manually', async () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setPackObserver');
const spy = jest.spyOn(NativeModules.MLNOfflineModule, 'setPackObserver');

const name = `test-${Date.now()}`;
const noop = () => {};
Expand All @@ -207,7 +207,7 @@ describe('offlineManager', () => {
});

it('should not set pack observer manually during create flow', async () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setPackObserver');
const spy = jest.spyOn(NativeModules.MLNOfflineModule, 'setPackObserver');

const name = `test-${Date.now()}`;
const noop = () => {};
Expand All @@ -223,7 +223,7 @@ describe('offlineManager', () => {
beforeEach(() => (Platform.OS = 'ios'));

it('should not set pack observer manually', async () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setPackObserver');
const spy = jest.spyOn(NativeModules.MLNOfflineModule, 'setPackObserver');

const name = `test-${Date.now()}`;
const noop = () => {};
Expand Down
6 changes: 3 additions & 3 deletions __tests__/modules/snapshot/SnapshotOptions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('SnapshotOptions', () => {
const options = new SnapshotOptions({centerCoordinate});

expect(options.toJSON()).toEqual({
styleURL: NativeModules.MGLModule.StyleURL.Default,
styleURL: NativeModules.MLNModule.StyleURL.Default,
heading: 0.0,
pitch: 0.0,
zoomLevel: 16.0,
Expand All @@ -39,7 +39,7 @@ describe('SnapshotOptions', () => {
height: 600,
writeToDisk: true,
withLogo: true,
styleURL: NativeModules.MGLModule.StyleURL.Default,
styleURL: NativeModules.MLNModule.StyleURL.Default,
};

const options = new SnapshotOptions(expectedOptions);
Expand All @@ -59,7 +59,7 @@ describe('SnapshotOptions', () => {
],
width: 400,
height: 600,
styleURL: NativeModules.MGLModule.StyleURL.Default,
styleURL: NativeModules.MLNModule.StyleURL.Default,
writeToDisk: false,
withLogo: true,
};
Expand Down
99 changes: 0 additions & 99 deletions android/rctmgl/src/main/java/com/mapbox/rctmgl/RCTMGLPackage.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 88b7fa0

Please sign in to comment.