2017-09-05 67 views

回答

0

檢查:https://developers.google.com/maps/documentation/android-api/views#restrict-panning

這將相機限制區域

您可以使用:

private GoogleMap mGoogleMap; 
// Create a LatLngBounds that includes Australia. 
private LatLngBounds YOUR_CITY_OR_COUNTRY = new LatLngBounds(
new LatLng(-23, -66), new LatLng(-43, -68)); 

// Set the camera to the greatest possible zoom level that includes the 
// bounds 
mGoogleMap.setLatLngBoundsForCameraTarget(YOUR_CITY_OR_COUNTRY);