You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
In our app, we show a screen with a map on it, which has a bottom overlay. This overlay can be dragged over the screen and snaps to certain positions. When the overlay is pulled all the way down, the map has a relatively small bottom padding that allows the drag handler to be visible. Using this small padding of 120, the bounds of the viewport are correctly centered and the whole viewport is visible.
If we now drag the panel up, we set a higher bottom padding of the 50% of the map height and expect the viewport to still be visible in the now smaller area of the map, e.g. by zooming out.
What actually happens is that the whole viewport is only shifted up slightly, not even in a way that the center would be correct, and no zooming out happens.
Steps to reproduce
set low bottom padding
move camera
set high bottom padding
move camera
Expected behavior
The viewport is visible in the now smaller area of the map.
Actual behavior
The viewport is shifted up slightly.
In the bottom position, padding is applied correctly and the whole viewport is visible
With the panel in the center position, the viewport is not shown correctly
We use the following code to set the bottom padding:
internalfunsetViewportPadding(left:Int, top:Int, right:Int, bottom:Int) {
mapReady {
val bounds =this.map?.projection?.getVisibleRegion(false)?.latLngBounds
if (bounds !=null) {
val cameraUpdate =CameraUpdateFactory.newLatLngBounds(bounds, 0)
this.map?.setPadding(left, top, right, bottom)
this.map?.animateCamera(cameraUpdate, 500)
}
}
}
Configuration
Android versions: 8/9 Device models: Pixel2/3, One Plus 5 Mapbox SDK versions: 8.0.1
The text was updated successfully, but these errors were encountered:
@samiede thank you for reaching out and using our products. Haven't had the time to reproduce your issue but here is an example of the same user experience that you are trying to achieve.
@tobrun We're experiencing the same problem. We want to zoom out and display a user's route in full, taking into account if a BottomSheet is open. However, when the route is tall and narrow, only the middle part of the route is shown, like in the second image above.
We're using Mapbox SDK 8.2.1
In our app, we show a screen with a map on it, which has a bottom overlay. This overlay can be dragged over the screen and snaps to certain positions. When the overlay is pulled all the way down, the map has a relatively small bottom padding that allows the drag handler to be visible. Using this small padding of 120, the bounds of the viewport are correctly centered and the whole viewport is visible.
If we now drag the panel up, we set a higher bottom padding of the 50% of the map height and expect the viewport to still be visible in the now smaller area of the map, e.g. by zooming out.
What actually happens is that the whole viewport is only shifted up slightly, not even in a way that the center would be correct, and no zooming out happens.
Steps to reproduce
Expected behavior
The viewport is visible in the now smaller area of the map.
Actual behavior
The viewport is shifted up slightly.
In the bottom position, padding is applied correctly and the whole viewport is visible
With the panel in the center position, the viewport is not shown correctly
We use the following code to set the bottom padding:
Configuration
Android versions: 8/9
Device models: Pixel2/3, One Plus 5
Mapbox SDK versions: 8.0.1
The text was updated successfully, but these errors were encountered: