-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounds padding not applied when using setCamera() on iOS on version 7.2.0 #715
Comments
Sorry for the code formatting, I really tried to fix it, but this markdown beats me :) |
This issue reproduces on version 8.0.0-beta1 too. Edit: On 8.0.0-beta1 it stopped working on Android too. Was there any change on native SDKs regarding setting of padding, that is not handled yet? |
On Android the issue appeared after the upgrade to mapbox-android-sdk 9.0.0. |
On iOS the issue appeared after the upgrade to Mapbox-iOS-SDK 5.7.0. It works fine if I downgrade to Mapbox-iOS-SDK 5.6.1. |
See https://github.com/mapbox/mapbox-gl-native-ios/releases for ios changelog and see https://github.com/mapbox/mapbox-gl-native-android/releases for android changelog |
Also there is this change but it should be in 5.6.1 and 8.6.3 mapbox/mapbox-gl-native#14664 |
I checked all MapBox-android-sdk changes between 8.6.0 and 9.0.0 and there is nothing related to camera padding. Only fi there was a change in mapbox-gl-native library. |
@cristian-calugar I could not reproduce the issue on Android w mapbox/9.0.0. If you disagree Please attach a complete sample like bellow. import React from 'react';
import {Button} from 'react-native';
import {
MapView,
ShapeSource,
LineLayer,
Camera,
} from '@react-native-mapbox-gl/maps';
const dist = 0.002;
const padding = 100;
const aLine = {
type: 'LineString',
coordinates: [
[-74.00597 - dist, 40.71427 - dist],
[-74.00597 + dist, 40.71427 + dist],
],
};
class BugReportExample extends React.Component {
render() {
return (
<>
<Button
title="move"
onPress={() => {
this.cameraRef.setCamera({
bounds: {
ne: [-74.00597 - dist, 40.71427 - dist],
sw: [-74.00597 + dist, 40.71427 + dist],
paddingLeft: padding * 1.1,
paddingRight: padding * 1.1,
paddingTop: padding * 1.1,
paddingBottom: padding * 1.1,
},
});
}}
/>
<MapView style={{flex: 1}}>
<Camera
ref={ref => (this.cameraRef = ref)}
bounds={{
ne: [-74.00597 - dist, 40.71427 - dist],
sw: [-74.00597 + dist, 40.71427 + dist],
paddingLeft: padding,
paddingRight: padding,
paddingTop: padding,
paddingBottom: padding,
}}
/>
<ShapeSource id="idStreetLayer" shape={aLine}>
<LineLayer id="idStreetLayer" style={{lineWidth: 4.0}} />
</ShapeSource>
</MapView>
</>
);
}
}
export default BugReportExample; |
Describe the bug
When calling setCamera with bounds padding on 7.2.0, the padding is not applied on iOS. The padding is applied in Android and also on iOS on version 7.0.9.
To Reproduce
Expected behavior
Bounds padding should be taken in consideration when setting camera, to be able to arrange the elements we want to display in the specified bounds in a specific area of the screen.
Versions (please complete the following information):
Edit ferdicus: used correct code formatting
The text was updated successfully, but these errors were encountered: