-
Notifications
You must be signed in to change notification settings - Fork 118
Behavior of Tilt with top padding #162
Comments
Hello, is there any plan to look at the problem ? We need to offset the map center on a tilted map, but I saw here : mapbox/mapbox-gl-native#11624 that the method for this is to use the map padding. As the top padding behavior is broken, it is not possible currently. |
To be more clear, we need to display a GPS where the user icon is not at the center of the screen, but rather at the bottom. Before (with mapbox 7.4) we used the map padding to achieve this, but now the performances are too low with this method. Maybe we are missing something and there is another way to do this ? |
mapbox/mapbox-gl-native#14664 correctly allowed the camera’s focal point to be uncentered. This is important for maintaining an accurate perspective effect in landscape layouts where there’s a large side padding, for instance. Unfortunately, the change did introduce several regressions such as the performance issue you’ve highlighted.
This issue is tracked upstream in mapbox/mapbox-gl-native#15163. One solution would be to load tiles intended for lower zoom levels further out from the focal point: mapbox/mapbox-gl-native#9037.
Conceptually, you want to set the camera such that a particular geographic coordinate is at a particular (uncentered) screen coordinate. It would be great to have an explicit setting for that. The iOS map SDK has historically had two independent settings, a persistent content inset (called “padding” on Android) and a transient edge padding. You could set a camera with an edge padding as a frame of reference; that padded camera was internally translated into a camera in which the center coordinate is the coordinate at the logical center of the map view. Offsetting the user location indicator relied on setting the camera with a large enough edge padding to take over the whole view, constraining the indicator to a single pixel towards the center bottom. Unfortunately, this approach also broke in mapbox/mapbox-gl-native#14664, because the transient edge padding was treated as a persistent content inset, affecting the perspective transform: mapbox/mapbox-gl-native#15233. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Reproduced with the demo sample :
Launch the sample and open the "Simple map view" activity
Zoom a little bit to see New York, and tilt at maximum level
Click on the "Change padding" button
Result : The tilt increases a lot, showing very distant tiles. As a result, the map is so slow it is no longer usable
Expected : The tilt should not be changed.
The text was updated successfully, but these errors were encountered: