本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.getUiSettings方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleMap.getUiSettings方法的具体用法?Java GoogleMap.getUiSettings怎么用?Java GoogleMap.getUiSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.getUiSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
public void onMapReady(GoogleMap googleMap) {
if (m_gMap == null) {
m_gMap = googleMap;
GoogleMap map = getMap();
if (map == null) {
MFBUtil.Alert(this, getString(R.string.txtError), getString(R.string.errNoGoogleMaps));
finish();
return;
}
map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
UiSettings settings = map.getUiSettings();
settings.setCompassEnabled(false);
settings.setRotateGesturesEnabled(false);
settings.setScrollGesturesEnabled(true);
settings.setZoomControlsEnabled(false);
settings.setZoomGesturesEnabled(true);
View mapView = getFragmentManager().findFragmentById(R.id.mfbMap).getView();
if (mapView != null && mapView.getViewTreeObserver() != null && mapView.getViewTreeObserver().isAlive()) {
mapView.getViewTreeObserver().addOnGlobalLayoutListener(this);
}
map.setOnMarkerClickListener(this);
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
map.setMyLocationEnabled(true);
}
map.setOnMapLongClickListener(this);
updateMapElements();
}
}
示例2: recapDisplayTrackSetupUI
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
/**
* Setup UI elements and gesture of the given GoogleMap. Used for recaps.
*
* @param googleMap map to setup
*/
public static void recapDisplayTrackSetupUI(GoogleMap googleMap) {
if (googleMap == null) {
throw new IllegalArgumentException();
}
googleMap.setBuildingsEnabled(false);
googleMap.setIndoorEnabled(false);
googleMap.setTrafficEnabled(false);
UiSettings uiSettings = googleMap.getUiSettings();
uiSettings.setCompassEnabled(false);
uiSettings.setIndoorLevelPickerEnabled(false);
uiSettings.setMapToolbarEnabled(false);
uiSettings.setZoomControlsEnabled(false);
uiSettings.setMyLocationButtonEnabled(false);
}
示例3: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
SummaryActivity.this.googleMap = googleMap;
googleMap.setTrafficEnabled(false);
googleMap.setBuildingsEnabled(false);
googleMap.setOnMyLocationButtonClickListener(this);
UiSettings mapUi = googleMap.getUiSettings();
mapUi.setMapToolbarEnabled(false);
mapUi.setAllGesturesEnabled(true);
mapUi.setTiltGesturesEnabled(false);
mapUi.setMyLocationButtonEnabled(true);
for (MarkerOptions markerOptions : pendingMarkersList)
addMarker(markerOptions);
pendingMarkersList.clear();
followUser = true;
if (ActivityCompat.checkSelfPermission(SummaryActivity.this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)
googleMap.setMyLocationEnabled(true);
Location location = LocationService.getBestLastKnownLocation(SummaryActivity.this);
if (location != null) {
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.moveCamera(CameraUpdateFactory.zoomTo(18));
}
}