Java Code Examples for com.google.android.gms.maps.UiSettings#setZoomGesturesEnabled()

The following examples show how to use com.google.android.gms.maps.UiSettings#setZoomGesturesEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SampleActivity.java    From clusterkraf with Apache License 2.0 6 votes vote down vote up
private void initMap() {
	if (map == null) {
		SupportMapFragment mapFragment = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
		if (mapFragment != null) {
			map = mapFragment.getMap();
			if (map != null) {
				UiSettings uiSettings = map.getUiSettings();
				uiSettings.setAllGesturesEnabled(false);
				uiSettings.setScrollGesturesEnabled(true);
				uiSettings.setZoomGesturesEnabled(true);
				map.setOnCameraChangeListener(new OnCameraChangeListener() {
					@Override
					public void onCameraChange(CameraPosition arg0) {
						moveMapCameraToBoundsAndInitClusterkraf();
					}
				});
			}
		}
	} else {
		moveMapCameraToBoundsAndInitClusterkraf();
	}
}
 
Example 2
Source File: MapSettingsActivity.java    From Complete-Google-Map-API-Tutorial with Apache License 2.0 5 votes vote down vote up
@Override
public void onMapReady(GoogleMap map)
{
	googleMap = map;

	UiSettings uiSettings = googleMap.getUiSettings();

	enableMyLocation();
	googleMap.setIndoorEnabled(true);
	googleMap.setBuildingsEnabled(true);
	googleMap.setTrafficEnabled(true);

	uiSettings.setCompassEnabled(true);
	uiSettings.setMyLocationButtonEnabled(true);
	uiSettings.setZoomControlsEnabled(true);
	uiSettings.setMapToolbarEnabled(true);
	uiSettings.setIndoorLevelPickerEnabled(true);

	uiSettings.setRotateGesturesEnabled(true);
	uiSettings.setScrollGesturesEnabled(true);
	uiSettings.setTiltGesturesEnabled(true);
	uiSettings.setZoomGesturesEnabled(true);
	uiSettings.setAllGesturesEnabled(true);

	googleMap.addMarker(new MarkerOptions().position(MADISON_SQUARE_GARDEN));
	googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(MADISON_SQUARE_GARDEN, 17));
}
 
Example 3
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 4 votes vote down vote up
/**
 * Event handler for when map is ready to receive update parameters.
 *
 * @param googleMap
 */
@Override
public void onMapReady(GoogleMap googleMap) {

    // Clear previous map if already there
    googleMap.clear();

    UiSettings settings = googleMap.getUiSettings();

    // Set location based flags
    if (locationManager != null) {
        settings.setMyLocationButtonEnabled(this.myLocationButton);
        googleMap.setMyLocationEnabled(this.showsUserLocation);
    }

    // Set all other flags
    settings.setScrollGesturesEnabled(this.scrollGestures);
    settings.setZoomGesturesEnabled(this.zoomGestures);
    settings.setTiltGesturesEnabled(this.tiltGestures);
    settings.setRotateGesturesEnabled(this.rotateGestures);
    settings.setCompassEnabled(this.compassButton);

    // Update the camera position
    if (cameraUpdate != null) {
        googleMap.moveCamera(cameraUpdate);
    }

    // Add the markers
    addMapMarkers(googleMap);
    googleMap.setOnMarkerClickListener(this);

    // Attach the event handlers
    if (firstMapReady) {
        googleMap.setOnCameraChangeListener(this);
        googleMap.setOnMapClickListener(this);
        googleMap.setOnMapLongClickListener(this);
        googleMap.setOnMarkerDragListener(this);
        googleMap.setOnMyLocationButtonClickListener(this);

        firstMapReady = false;
    }
}
 
Example 4
Source File: TagsDemoActivity.java    From android-samples with Apache License 2.0 4 votes vote down vote up
@Override
public void onMapReady(GoogleMap map) {
    mMap = map;

    UiSettings mUiSettings = mMap.getUiSettings();

    // Turn off the map toolbar.
    mUiSettings.setMapToolbarEnabled(false);

    // Disable interaction with the map - other than clicking.
    mUiSettings.setZoomControlsEnabled(false);
    mUiSettings.setScrollGesturesEnabled(false);
    mUiSettings.setZoomGesturesEnabled(false);
    mUiSettings.setTiltGesturesEnabled(false);
    mUiSettings.setRotateGesturesEnabled(false);

    // Add a circle, a ground overlay, a marker, a polygon and a polyline to the map.
    addObjectsToMap();

    // Set listeners for click events.  See the bottom of this class for their behavior.
    mMap.setOnCircleClickListener(this);
    mMap.setOnGroundOverlayClickListener(this);
    mMap.setOnMarkerClickListener(this);
    mMap.setOnPolygonClickListener(this);
    mMap.setOnPolylineClickListener(this);

    // Override the default content description on the view, for accessibility mode.
    // Ideally this string would be localised.
    map.setContentDescription(getString(R.string.tags_demo_map_description));

    // Create bounds that include all locations of the map.
    LatLngBounds bounds = new LatLngBounds.Builder()
            .include(ADELAIDE)
            .include(BRISBANE)
            .include(DARWIN)
            .include(HOBART)
            .include(PERTH)
            .include(SYDNEY)
            .build();
    mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));
}