本文整理汇总了Java中com.google.android.gms.maps.GoogleMapOptions.zoomControlsEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleMapOptions.zoomControlsEnabled方法的具体用法?Java GoogleMapOptions.zoomControlsEnabled怎么用?Java GoogleMapOptions.zoomControlsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.GoogleMapOptions
的用法示例。
在下文中一共展示了GoogleMapOptions.zoomControlsEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMap
import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
private SupportMapFragment createMap()
{
GoogleMapOptions options = new GoogleMapOptions();
options.useViewLifecycleInFragment( true );
options.compassEnabled( false );
options.zoomControlsEnabled( false );
final boolean mapControlEnabled = true;
options.zoomGesturesEnabled( mapControlEnabled );
options.scrollGesturesEnabled( mapControlEnabled );
options.rotateGesturesEnabled( mapControlEnabled );
options.tiltGesturesEnabled( mapControlEnabled );
options.mapType( GoogleMap.MAP_TYPE_SATELLITE );
CameraPosition camPos = new CameraPosition( DEFAULT_LOCATION, 0.0f, 30f, 0.0f );
options.camera( camPos );
SupportMapFragment mapFragment = SupportMapFragment.newInstance( options );
return mapFragment;
}
示例2: createMap
import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
private MapFragment createMap()
{
GoogleMapOptions options = new GoogleMapOptions();
options.useViewLifecycleInFragment( true );
options.compassEnabled( false );
options.zoomControlsEnabled( false );
final boolean mapControlEnabled = geMapControlsEnabled();
options.zoomGesturesEnabled( mapControlEnabled );
options.scrollGesturesEnabled( mapControlEnabled );
options.rotateGesturesEnabled( mapControlEnabled );
options.tiltGesturesEnabled( mapControlEnabled );
options.mapType( GoogleMap.MAP_TYPE_SATELLITE );
CameraPosition camPos = new CameraPosition( getLocation(), 0.0f, 30f, 0.0f );
options.camera( camPos );
MapFragment mapFragment = MapFragment.newInstance( options );
return mapFragment;
}
示例3: onMapReady
import com.google.android.gms.maps.GoogleMapOptions; //导入方法依赖的package包/类
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
map = googleMap;
if (map == null) return;
map.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_style));
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(22.3964, 114.1095), 10));
GoogleMapOptions options = new GoogleMapOptions();
options.mapToolbarEnabled(false);
options.compassEnabled(true);
options.rotateGesturesEnabled(true);
options.scrollGesturesEnabled(false);
options.tiltGesturesEnabled(true);
options.zoomControlsEnabled(false);
options.zoomGesturesEnabled(true);
map.setBuildingsEnabled(false);
map.setIndoorEnabled(false);
map.setTrafficEnabled(false);
map.setOnMarkerClickListener(this);
if (ActivityCompat.checkSelfPermission(getContext(),
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
ActivityCompat.checkSelfPermission(getContext(),
Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
map.setMyLocationEnabled(true);
}
if (busRouteStops != null && busRouteStops.size() > 0) {
PolylineOptions line = new PolylineOptions().width(20).zIndex(1)
.color(ContextCompat.getColor(getContext(), R.color.colorAccent));
for (BusRouteStop stop: busRouteStops) {
LatLng latLng = new LatLng(Double.parseDouble(stop.latitude), Double.parseDouble(stop.longitude));
line.add(latLng);
IconGenerator iconFactory = new IconGenerator(getContext());
Bitmap bmp = iconFactory.makeIcon(stop.sequence + ": " + stop.name);
map.addMarker(new MarkerOptions().position(latLng)
.icon(BitmapDescriptorFactory.fromBitmap(bmp))).setTag(stop);
}
line.startCap(new RoundCap());
line.endCap(new RoundCap());
map.addPolyline(line);
if (busRouteStops.size() < goToStopPos) {
goToStopPos = 0;
}
map.moveCamera(CameraUpdateFactory.newLatLngZoom(
new LatLng(Double.parseDouble(busRouteStops.get(goToStopPos).latitude),
Double.parseDouble(busRouteStops.get(goToStopPos).longitude)), 16));
}
}