Felipe Souza Felipe Souza - 5 months ago 11
Java Question

How can i display points on map without cut?

I need center 2 point on map, but when i use this code point are displayed cut :

LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (int i=0;i<this.posicoesDispositivos.size();i++) {
LatLngBounds bounds = builder.build();
if (primeiraExecucao) {
mMapa.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 0));
primeiraExecucao = false;

Image of display of this code:

enter image description here

CameraUpdateFactory.newLatLngBounds(bounds, 0)

The last parameter that you are passing 0 is padding. You can change the value of padding to get the desired result such as

CameraUpdateFactory.newLatLngBounds(bounds, 20)

In this case 20 pixels will be added on all 4 sizes of bounding box.