0
您能否告訴我們是否有使用Google Maps API for Android的方式僅顯示特定的國家/城市而不是整個地圖?在Google地圖上顯示特定區域
您能否告訴我們是否有使用Google Maps API for Android的方式僅顯示特定的國家/城市而不是整個地圖?在Google地圖上顯示特定區域
檢查: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);