5
Speak guys, I’m making an app, and in an app Activity need from my location to "zoom" in the maps as the user slides a seekBar, as per the image.
I’ve been thinking about using the Bounds feature on the maps, where I can pass two longitudes and latitudes so that the maps create a border and zoom.
LatLngBounds bounds = new LatLngBounds.Builder()
.include(providerLocation)
.include(myLocation)
.build();
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, getWidthScreen()-0, getHeightScreen()-0, 190));
My problem is this, I’m not able to calculate from my point the latitude of an X1 point, an x2 point, which would be the reference points.
I appreciate all your help !!!
I have to do some research on this Sphericautil, to see if that’s what it is. Well I did, but it would be better an exact calculation that performed the spacing from my center to the diagonal corner of the maps.
– Jonathan Sales
Cameraupdatefactory.newLatLngBounds() did not do this?
– ramaral
well, I’m using it to reset the camera, and zoom in, but first I have to pass the Bolts to him, and that’s what I’m locking on to, I have to calculate a Latlng from the left position and one from the right position, ai include in Bounds and after step as parameter in Cameraupdatefactory.newLatLngBounds().
– Jonathan Sales
What I’m asking is whether the
CameraUpdateFactory.newLatLngBounds()
with the Bound calculated the way I indicated it didn’t do it?– ramaral
Yes, with Bound caculated, but with this calculation did not generate the required zoom.
– Jonathan Sales
Try using it like this
CameraUpdateFactory.newLatLngBounds(bounds, 0);
– ramaral