回答

0

例如,您可以使用moveCamera以及上次存儲的位置(lat,lng或zoomLevel)。

final LatLng location = new LatLng(..., ...);// Loaded from SharedPreferences maybe. 

// Move the camera to location with a zoom of 15. 
map.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 15)); 
0

您可以使用此示例代碼的直接映射動畫到你的城市座標(緯度,經度),並自動縮小到指定級別:

// Set desired lat lng location, and zoom level (for example 10) 
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(locationCity.getLatitude(), locationCity.getLongitude()), 10); 
// Move the camera to location 
gMap.animateCamera(cameraUpdate); 
相關問題