-
Notifications
You must be signed in to change notification settings - Fork 116
Map padding not working properly after sdk update #282
Comments
@zsoltbakos thanks for all of the detail. We did make an adjustment to the way that padding works, but it should be backwards compatible in that there is a way to achieve the same result as before. Take a look at mapbox/mapbox-gl-native#15444 and see if that helps you update your implementation. cc @LukasPaczos |
Thanks for reporting the issue @zsoltbakos. There might also be an issue with the order of the calls - to keep backward compatibility, the |
@chloekraw & @LukasPaczos thanks for the tips. I don't use Mapbox's LocationComponent, so maybe that's one way to solve this issue. I'll try it out at the weekend and make a feedback about the result. |
Sorry for the late reply. Unfortunately, using a locationComponent does not solve my problem. When I set the padding within LocationComponentOptions (which is deprecated), it does simply not work - just like setting it in the mapView's setting. This is how I tried:
If I use LocationComponent, and set the padding with a cameraUpdate, it is still very laggy:
|
@zsoltbakos Did you find a workaround for this issue ? I have the same problem, see #162 . Currently all I can do to avoid the lag is modifying the source transform.cpp to limit the tilt when there is padding, but there are other issues (the zoom level is not the same)... |
@philemonmerlet No, so I'm still using the old version of the sdk. 😞 |
After playing with the new maxPitchPreference (from MapboxMap or MapboxMapOptions), setting it to 45 instead of 60 seems to restore the correct behavior (no more lag when using padding, and the actual visible pitch is close to before, only a bit more far away). Maybe it can work for your case, it looks similar. |
Thanks, it seems to fix the issue. |
I think this issue should not be closed. It is still valid. I am using the version 9.2.0 and padding has no effect when I use |
The workaround explained by @philemonmerlet fixed the issue for me, but if you think it is still a bug and the above solution is not working for you, then I reopen it. |
Hi all,
I recently upgraded the sdk in my app from version 7.3.2 to 9.0.1.
In the previous version, I set padding with
mapboxMap.setPadding(leftPadding, topPadding, 0, 0)
. With that, I managed to display my current location in the bottom of the screen, so the upper part of the map is still visible. It is a required feature of the app as it is used by drivers who want to see the upcoming part of their trip. (Image 1)In the newer version,
mapboxMap.setPadding()
is deprecated and completely unusable. Padding is not working, when I navigate to my position, it is shown in the center of the screen (Image 2). I found in the docs that it's recommended to use eitherCameraUpdateFactory.paddingTo()
withmapboxMap.moveCamera()
, orCameraUpdate.Builder#padding()
. The former is simply not working; when I try to navigate to a location, it does nothing. The latter is almost perfect, with the only problem being that it makes the whole map extremely laggy.Is it a bug in the sdk which will be fixed, or is there any other way for setting the padding of the map?
Image 1 - how it worked in the old version, and should work
Image 2 - how it works in new version, without touching the code
The text was updated successfully, but these errors were encountered: