當前位置: 首頁>>代碼示例>>Java>>正文


Java UiSettings類代碼示例

本文整理匯總了Java中com.google.android.gms.maps.UiSettings的典型用法代碼示例。如果您正苦於以下問題:Java UiSettings類的具體用法?Java UiSettings怎麽用?Java UiSettings使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UiSettings類屬於com.google.android.gms.maps包,在下文中一共展示了UiSettings類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;
    mMap.setIndoorEnabled(true);
    mMap.setMyLocationEnabled(false);
    mMap.setOnMarkerClickListener(this);
    mMap.setOnIndoorStateChangeListener(this);
    mMap.setOnMapClickListener(this);
    UiSettings mapUiSettings = mMap.getUiSettings();
    mapUiSettings.setZoomControlsEnabled(false);
    mapUiSettings.setMapToolbarEnabled(false);

    // load all markers
    LoaderManager lm = getLoaderManager();
    lm.initLoader(TOKEN_LOADER_MARKERS, null, mMarkerLoader).forceLoad();

    // load the tile overlays
    lm.initLoader(TOKEN_LOADER_TILES, null, mTileLoader).forceLoad();

    setupMap(true);
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:22,代碼來源:MapFragment.java

示例2: init

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
public void init() {
  getMapAsync(new OnMapReadyCallback() {
    @Override public void onMapReady(GoogleMap googleMap) {
      if (googleMap != null && getActivity() != null) {
        NativeGoogleMapFragment.this.googleMap = googleMap;
        UiSettings settings = NativeGoogleMapFragment.this.googleMap.getUiSettings();
        settings.setZoomControlsEnabled(false);
        settings.setMyLocationButtonEnabled(false);
        setMyLocationEnabled(myLocationEnabled);

        if (onMapLoadedListener != null) {
          onMapLoadedListener.onMapLoaded();
        }
      }
    }
  });
}
 
開發者ID:airbnb,項目名稱:AirMapView,代碼行數:18,代碼來源:NativeGoogleMapFragment.java

示例3: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的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();
    }
}
 
開發者ID:ericberman,項目名稱:MyFlightbookAndroid,代碼行數:34,代碼來源:ActFlightMap.java

示例4: recapDisplayTrackSetupUI

import com.google.android.gms.maps.UiSettings; //導入依賴的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);
}
 
開發者ID:IrrilevantHappyLlamas,項目名稱:Runnest,代碼行數:23,代碼來源:UtilsUI.java

示例5: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onMapReady(GoogleMap googleMap) {

    mMap = googleMap;
    int marca = 0;

    for (Punto incidencia :incidencias) {
        mMap.addMarker(new MarkerOptions().position(new LatLng(incidencia.getX(), incidencia.getY())).icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_VIOLET)));
    }

    for (Punto punto : puntos) {
        mMap.addMarker(new MarkerOptions().position(new LatLng(punto.getX(), punto.getY())).title("Step " + (++marca)));
    }
    mMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(puntos.get(0).getX(), puntos.get(0).getY())));

    UiSettings ui = mMap.getUiSettings();
    ui.setZoomControlsEnabled(true);


    for (int i = 0; i < puntos.size() - 1; i++) {
        PolylineOptions linea = new PolylineOptions().add(new LatLng(puntos.get(i).getX(), puntos.get(i).getY())).add(new LatLng(puntos.get(i + 1).getX(), puntos.get(i + 1).getY()));
        linea.color(Color.BLUE);
        linea.width(3f);
        mMap.addPolyline(linea);
    }
}
 
開發者ID:santiihoyos,項目名稱:LazarilloApp,代碼行數:27,代碼來源:MapsActivity.java

示例6: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onMapReady(GoogleMap googleMap) {
    mGoogleMap = googleMap;
    mGoogleMap.setMyLocationEnabled(true);
    mGoogleMap.setOnMyLocationButtonClickListener(this);
    mGoogleMap.setOnMarkerClickListener(this);
    mGoogleMap.setOnInfoWindowClickListener(this);
    UiSettings settings = mGoogleMap.getUiSettings();
    settings.setTiltGesturesEnabled(false);
    settings.setCompassEnabled(true);
    settings.setTiltGesturesEnabled(true);
    settings.setMyLocationButtonEnabled(true);
    settings.setMapToolbarEnabled(false);



}
 
開發者ID:kiideveloper,項目名稱:pokiimap-human,代碼行數:18,代碼來源:MapWrapperFragment.java

示例7: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onMapReady(GoogleMap googleMap) {
    mGoogleMap = googleMap;

    UiSettings settings = mGoogleMap.getUiSettings();
    settings.setCompassEnabled(true);
    settings.setTiltGesturesEnabled(true);
    settings.setMyLocationButtonEnabled(false);
    //Handle long click
    mGoogleMap.setOnMapLongClickListener(this);
    mGoogleMap.setOnMapClickListener(this);
    mGoogleMap.setOnMarkerClickListener(this);
    //Disable for now coz is under FAB
    settings.setMapToolbarEnabled(false);

    initMap(false, false);
}
 
開發者ID:shivarajp,項目名稱:LivePokemonFinder,代碼行數:18,代碼來源:MapWrapperFragment.java

示例8: initGoogleMap

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@NeedsPermission(Manifest.permission.ACCESS_FINE_LOCATION)
void initGoogleMap() {
    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);

    mapFragment.getMapAsync(googleMap -> {
        //noinspection MissingPermission
        googleMap.setMyLocationEnabled(true);
        binding.mapSearchView.bindData(placeMapList, placeMap -> {
            LatLng latLng = new LatLng(placeMap.latitude, placeMap.longitude);
            int duration = getResources().getInteger(R.integer.map_camera_move_mills);
            googleMap.animateCamera(CameraUpdateFactory.newLatLng(latLng), duration, null);
            Marker marker = markers.get(placeMap.nameRes);
            if (marker != null) marker.showInfoWindow();
        });

        binding.loadingView.setVisibility(View.GONE);
        googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        googleMap.setIndoorEnabled(true);
        googleMap.setBuildingsEnabled(true);
        googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LAT_LNG_CENTER, DEFAULT_ZOOM));
        UiSettings mapUiSettings = googleMap.getUiSettings();
        mapUiSettings.setCompassEnabled(true);
        renderMarkers(placeMapList, googleMap);
    });
}
 
開發者ID:konifar,項目名稱:droidkaigi2016,代碼行數:26,代碼來源:MapFragment.java

示例9: onActivityCreated

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	mMap = getMap();
	if(mMap != null) {
		UiSettings settings = mMap.getUiSettings();
		settings.setCompassEnabled(true);
		settings.setMyLocationButtonEnabled(true);
		mMap.setMyLocationEnabled(true);
        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        mMap.setTrafficEnabled(true);
        mMap.setOnMarkerClickListener(this);
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sNCLatLng, 6), 1, null);
	} else {
		Toast.makeText(getActivity(), "Error accessig Maps API", Toast.LENGTH_SHORT).show();
	}
	mActionBar = ((ActionBarActivity) getActivity()).getSupportActionBar();
}
 
開發者ID:emuneee,項目名稱:nc-traffic-cams-open,代碼行數:19,代碼來源:MapFragment.java

示例10: onResume

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onResume() {
    super.onResume();
    
    // Set up map if we haven't done so yet
    if (map == null) {
        // Remove the toolbar
        map = mapFragment.getMap();
        UiSettings settings = map.getUiSettings();
        settings.setMapToolbarEnabled(false);
        
        if (editable) {
            map.setOnMapClickListener(new OnMapClickListener() {
                @Override
                public void onMapClick(LatLng arg0) {
                    launchSelectLocationActivity();
                }
            });
        }
    }
    
    updateMap();
}
 
開發者ID:TravelTracker,項目名稱:TravelTracker,代碼行數:24,代碼來源:SelectLocationFragment.java

示例11: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onMapReady() {
    if (mGoogleMap == null) {
        mGoogleMap = mMapFragment.getMap();
        if (mGoogleMap != null) {
            // You are good to use the map =)
            final UiSettings uiSettings = mGoogleMap.getUiSettings();
            uiSettings.setCompassEnabled(false);
            uiSettings.setZoomControlsEnabled(false);

            // Draw the paths
            if (!mDrawing.getEncodedPolylines().isEmpty()) {
                final LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
                for (String encodedPath : mDrawing.getEncodedPolylines()) {
                    final List<LatLng> pathPoints = PolyUtil.decode(encodedPath);
                    mGoogleMap.addPolyline(mPathOptions).setPoints(pathPoints);
                    for (LatLng point : pathPoints) {
                        boundsBuilder.include(point);
                    }
                }
                animateCameraToBounds(boundsBuilder.build());
                mDrawingLength.setText(getString(R.string.activity_drawing_viewer_drawing_length, mDrawing.getLength()));
            }
        }
    }
}
 
開發者ID:tvbarthel,項目名稱:SayItFromTheSky,代碼行數:27,代碼來源:DrawingViewerActivity.java

示例12: onResume

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onResume() {
    super.onResume();
    if (map == null) {
        map = mapFragment.getMap();
        
        map.setMyLocationEnabled(true);
        
        UiSettings uiSettings = map.getUiSettings();
        uiSettings.setMyLocationButtonEnabled(true);
        uiSettings.setCompassEnabled(true);
        uiSettings.setZoomControlsEnabled(false);
        
        map.setOnMapClickListener(clickListener);
    }
}
 
開發者ID:ganterd,項目名稱:TravelReminder,代碼行數:17,代碼來源:ReminderEditLocationInfo.java

示例13: initMap

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
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();
	}
}
 
開發者ID:twotoasters,項目名稱:clusterkraf,代碼行數:23,代碼來源:SampleActivity.java

示例14: setMapSettings

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
private void setMapSettings() {
    UiSettings settings = getUiSettings();
    settings.setScrollGesturesEnabled(true);
    settings.setRotateGesturesEnabled(true);
    settings.setCompassEnabled(true);
    settings.setZoomControlsEnabled(false);
    settings.setTiltGesturesEnabled(false);
    settings.setMapToolbarEnabled(false);
    settings.setMyLocationButtonEnabled(false);
    setMarkers();
}
 
開發者ID:ArnauBlanch,項目名稱:civify-app,代碼行數:12,代碼來源:CivifyMap.java

示例15: onMapReady

import com.google.android.gms.maps.UiSettings; //導入依賴的package包/類
@Override
public void onMapReady(GoogleMap map) {
    googleMap = map;
    googleMap.setMyLocationEnabled(locationEnabled);
    googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);

    UiSettings uiSettings = googleMap.getUiSettings();
    uiSettings.setZoomControlsEnabled(true);
    uiSettings.setCompassEnabled(true);
    uiSettings.setMyLocationButtonEnabled(true);
    uiSettings.setMapToolbarEnabled(true);

    googleMap.setMinZoomPreference(15);
    googleMap.setMaxZoomPreference(20);

    googleMap.setLatLngBoundsForCameraTarget(SSN_COLLEGE);

    Set<Map.Entry<String, LatLng>> entries = stringToLatLngMap.entrySet();
    Iterator iterator = entries.iterator();
    while (iterator.hasNext()) {
        Map.Entry<String, LatLng> entry = (Map.Entry) iterator.next();
        googleMap.addMarker(new MarkerOptions()
                .position(entry.getValue()).title(entry.getKey()));
    }

    centerOnLocation();
}
 
開發者ID:adithya321,項目名稱:Instincts-2k17,代碼行數:28,代碼來源:MapsActivity.java


注:本文中的com.google.android.gms.maps.UiSettings類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。