-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[android] Setting padding moves camera #15412
Comments
Is the problem that camera padding is now animated movement? Otherwise, please check issues #15269 and #15199 as this is related. As mentioned in #15199. padding pushes center of content area to area defined by padding. 1000 is too large IMHO - as explained in #15411 (comment). |
Let's assume it's correct padding. It's move center as desired to approximatly 78% of screen height. Problem is that it's scrolling map camera with the same value. Previous versions 6.x 7.x didn't work like that. |
Could you please take screenshot or video of the wrong behavior - with a note about expected and actual behavior? It sounds contradictory that moving center is desired but map scrolling is not. Thanks. Edit: in the original pull request #14664, you'd find animated gifs that might help clarifying the issue. |
@2Rec
It is not obvious to me what before/after padding change means - is it about 1. previous version vs current version of SDK, or 2. before calling app.setPadding(0,0,1000,0) and after calling ap.setPadding(0,0,1000,0). if it is case 2, please share further information, e.g. what was padding before. Let me analyze the images. If you set padding (0,0,1000,0) and set camera to user location, it should be like on image 1. Let's compare it to screenshot of our Android example: #14664 (comment) Center point set using this code is moved to the center of padded area. If that is not what you see, let's try to debug the issue.
Second screenshot looks like as if padding is set to 0 or if there is code that is calculating center that is offset from user location and setting camera to it. Please share the code snippets for setting camera and location and it should help us identify the issue. |
ok, true first image is padding (0,0, value, 0), second is after clearing (0,0,0,0)
It's possible to make workaround by moving Camera to have it in the same place (before and after padding change) (but for what?) |
Hey @2Rec! In previous versions of the SDK, going from padding That said, I can see a scenario where this brings additional challenges, for example:
Is this scenario similar to what you're struggling with? I think to resolve this issue we should do the following steps:
or just invalidate the camera internally and suggest that in examples when setting the padding.
|
@LukasPaczos |
In previous Mapbox versions setting padding doesn't couse camera movement.
Steps to reproduce
Expected behavior
No camera movement
Actual behavior
Camera flips by padding value
Configuration
Android versions: 8.2.1
Device models: HTC U11
Mapbox SDK versions: 8.2.1
The text was updated successfully, but these errors were encountered: