Stefano Zanella
Stefano Zanella

Reputation: 113

MapBox Android: use padding in the correct way

I am trying to virtually reduce the bounds of MapBox visibleArea for getting a region smaller than the real one. The reason is that I am going to send the coordinates to a service that will return back a list of points and I want to be sure that these points are all visible in map. So I would like to use the padding to virtually reduce the bounds that I am going to send.

Until now I have tried many ways, for example mapbox.setPadding() that is deprecated and CameraUpdateFactory.paddingTo() but no method seems to work correctly and I do not understand which is the correct approach. The problem is that I am not able to find any guide/tutorial/example that shows up how to correctly use padding and the official documentation on the usage of padding is IMHO quite poor.

Does anyone found or know something useful on this topic?

At the moment I am using the most recent mapbox stable version (9.6.1).

Thank you in advance!

Upvotes: 1

Views: 962

Answers (1)

A.Alqadomi
A.Alqadomi

Reputation: 1589

Sadly the only way I got the padding to work (as you described) was to upgrade to mapbox 10 .

in 9.2 it used to work in a strange way (it was pushing rather than reducing) but at 9.6 it stopped working completely .

Upvotes: 0

Related Questions