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


Java CameraUpdateFactory.newLatLngZoom方法代碼示例

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


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

示例1: showColegiElectoralData

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
public void showColegiElectoralData(final ColegiElectoral colegiElectoral) {
    LatLng latLng = new LatLng(colegiElectoral.getLat(), colegiElectoral.getLon());
    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 16);
    mGoogleMap.animateCamera(cameraUpdate);

    txtNomLocal.setText(colegiElectoral.getLocal());
    txtAdresa.setText(colegiElectoral.getAdresa());
    txtLocalitat.setText(colegiElectoral.getMunicipi());
    txtDistricte.setText(colegiElectoral.getDistricte() != null ? StringsManager.getString("data_districte", colegiElectoral.getDistricte()) : "");
    txtSeccio.setText(colegiElectoral.getSeccio() != null ? StringsManager.getString("data_seccio", colegiElectoral.getSeccio()) : "");
    txtMesa.setText(colegiElectoral.getMesa() != null ? StringsManager.getString("data_mesa", colegiElectoral.getMesa()) : "");

    icnCalendari.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            addEventToCalendar(colegiElectoral);
        }
    });

    bsb.setState(BottomSheetBehavior.STATE_EXPANDED);
}
 
開發者ID:mosquitolabs,項目名稱:referendum_1o_android,代碼行數:22,代碼來源:VoteFragment.java

示例2: gotoLocation

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
/**
 * For actually moving the map to the desired location.
 * @param fctx
 * @param loc
 */
public static void gotoLocation(Activity fctx, Location loc) {
    Location locc = loc;
    sloc = loc;
    if(loc == null){
        locc = getCurrentLocation(fctx);
    }
    if(code == AddHabitEventActivity.EVENT_PERMISSION_CHECK){
    }

    float zoom = 15.0f;
    if(locc == null){
        DummyMainActivity.toastMe("Could not get location", fctx);
    }else{
        double[] d = {locc.getLatitude(), locc.getLongitude()};
        AddHabitEventActivity.setLocation(d);

        LatLng ll = new LatLng(locc.getLatitude(), locc.getLongitude());
        CameraUpdate update = CameraUpdateFactory.newLatLngZoom(ll, zoom);
        gmap.moveCamera(update);
    }
}
 
開發者ID:CMPUT301F17T17,項目名稱:Habitizer,代碼行數:27,代碼來源:MapController.java

示例3: getMapFragmentInitialState

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
@Override
public CameraUpdate getMapFragmentInitialState(HyperTrackMapFragment hyperTrackMapFragment) {
    if (SharedPreferenceManager.getLastKnownLocation(context) != null) {
        LatLng latLng = new LatLng(SharedPreferenceManager.getLastKnownLocation(context).getLatitude(),
                SharedPreferenceManager.getLastKnownLocation(context).getLongitude());
        return CameraUpdateFactory.newLatLngZoom(latLng, 15.0f);
    }
    return super.getMapFragmentInitialState(hyperTrackMapFragment);
}
 
開發者ID:hypertrack,項目名稱:hypertrack-live-android,代碼行數:10,代碼來源:HomeMapAdapter.java

示例4: createMarker

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
private void createMarker(String acode, LatLng location, double latitude, double longitude) {
    Marker mMarker = null;
    if (acode!= null) {

        mMap.setOnMarkerClickListener(this);
        mMap.addMarker(new MarkerOptions().position(new LatLng(latitude,longitude)).anchor(0.5f, 0.5f).title(acode));
        //mMarker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.pegman));

        CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(latitude,longitude), 10);
        mMap.animateCamera(cameraUpdate);

    }
}
 
開發者ID:addy-org,項目名稱:Addy-Android,代碼行數:14,代碼來源:MapsActivity.java

示例5: createMarkerLatLng

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
private void createMarkerLatLng(CharSequence name, LatLng latLng_local) {
    Marker mMarker = null;
    if (name!= null) {

        mMap.setOnMarkerClickListener(this);
        mMap.addMarker(new MarkerOptions().position(latLng_local).anchor(0.5f, 0.5f).title(name.toString()));
        //mMarker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.pegman));

        CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng_local, 10);
        mMap.animateCamera(cameraUpdate);


    }
}
 
開發者ID:addy-org,項目名稱:Addy-Android,代碼行數:15,代碼來源:MapsActivity.java

示例6: onLocationChanged

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
/**
 * Notifier for change in device's location
 * @param location
 */
@Override
public void onLocationChanged(Location location) {
    LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 10);

    mMap.moveCamera(cameraUpdate);

    if (client != null) {
        LocationServices.FusedLocationApi.removeLocationUpdates(client, this);
    }

}
 
開發者ID:CMPUT301F17T23,項目名稱:routineKeen,代碼行數:17,代碼來源:MapsActivity.java

示例7: onMapReady

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;
    mMap.getUiSettings().setMapToolbarEnabled(false);
    LatLng latLng = new LatLng(Prefs.LastLatitude.getDouble(), Prefs.LastLongitude.getDouble());
    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 16);
    googleMap.moveCamera(cameraUpdate);
    setMarkers(mMap, mRestaurants);
}
 
開發者ID:boldijar,項目名稱:today-menu-android,代碼行數:10,代碼來源:RestaurantsMapFragment.java

示例8: zoomToCurrentPosition

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
public void zoomToCurrentPosition() {
    if (mMap == null) {
        return;
    }
    LatLng latLng = new LatLng(Prefs.LastLatitude.getDouble(), Prefs.LastLongitude.getDouble());
    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 16);
    mMap.animateCamera(cameraUpdate);
}
 
開發者ID:boldijar,項目名稱:today-menu-android,代碼行數:9,代碼來源:RestaurantsMapFragment.java

示例9: updateUI

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
private void updateUI() {
    if (mMap == null) {
        return;
    }
    
    LatLng placePoint = new LatLng(mLocation.getLatitude(), mLocation.getLongitude());
    MarkerOptions placeMarker = new MarkerOptions().position(placePoint);
    
    mMap.clear();
    CameraUpdate update = CameraUpdateFactory.newLatLngZoom(placePoint, MAP_ZOOM_LEVEL);
    mMap.animateCamera(update);
    mMap.addMarker(placeMarker);
}
 
開發者ID:plweegie,項目名稱:piast-trail,代碼行數:14,代碼來源:PlaceDetailsActivity.java

示例10: onLocationChanged

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
public void onLocationChanged(Location location) {
    // Called when a new location is found by the network location provider.
    //makeUseOfNewLocation(location);
    LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 20);
    map.animateCamera(cameraUpdate);
    locationManager.removeUpdates(this);
}
 
開發者ID:curbmap,項目名稱:curbmap-android,代碼行數:9,代碼來源:HomeFragment.java

示例11: updateMapView

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
private void updateMapView() {
    if (mMap == null || !isMapLoaded) {
        return;
    }

    if (currentLocationMarker == null && expectedPlace == null) {
        return;
    }

    LatLngBounds.Builder builder = new LatLngBounds.Builder();

    if (currentLocationMarker != null) {
        LatLng current = currentLocationMarker.getPosition();
        builder.include(current);
    }

    if (expectedPlace != null && expectedPlace.getLocation() != null &&
            expectedPlace.getLocation().getLatLng() != null) {
        LatLng destination = expectedPlace.getLocation().getLatLng();
        builder.include(destination);
    }

    LatLngBounds bounds = builder.build();

    try {
        CameraUpdate cameraUpdate;
        if (expectedPlace != null && currentLocationMarker != null) {
            int width = getResources().getDisplayMetrics().widthPixels;
            int height = getResources().getDisplayMetrics().heightPixels;
            int padding = (int) (width * 0.12);
            cameraUpdate = CameraUpdateFactory.newLatLngBounds(bounds, width, height, padding);
        } else {
            LatLng latLng = currentLocationMarker != null ?
                    currentLocationMarker.getPosition() : expectedPlace.getLocation().getLatLng();
            cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, zoomLevel);
        }

        mMap.animateCamera(cameraUpdate, 1000, null);

    } catch (Exception e) {
        e.printStackTrace();
        Crashlytics.logException(e);
    }
}
 
開發者ID:hypertrack,項目名稱:hypertrack-live-android,代碼行數:45,代碼來源:Home.java

示例12: goToLocation

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
private void goToLocation(double lon, double lat, int zoom) {
    LatLng lg = new LatLng(lon, lat);
    CameraUpdate update = CameraUpdateFactory.newLatLngZoom(lg, zoom);
    mGoogleMap.animateCamera(update);
}
 
開發者ID:rahul051296,項目名稱:quake-alert-android-app,代碼行數:6,代碼來源:QuakeDetailsActivity.java

示例13: getCameraUpdate

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
protected static CameraUpdate getCameraUpdate(Location location, float zoom) {
    return CameraUpdateFactory.newLatLngZoom(LocationAdapter.getLatLng(location), zoom);
}
 
開發者ID:ArnauBlanch,項目名稱:civify-app,代碼行數:4,代碼來源:CivifyMap.java

示例14: muoviCamera

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
/**
 * Riposiziona la camera con un'animazione
 */
public void muoviCamera(LatLng coordinate) {
    CameraUpdate location = CameraUpdateFactory.newLatLngZoom(coordinate, 16);
    mGoogleMap.animateCamera(location);
}
 
開發者ID:IelloDevTeam,項目名稱:IelloAndroidApp,代碼行數:8,代碼來源:MappaGoogle.java

示例15: muoviMappaConAnimazione

import com.google.android.gms.maps.CameraUpdateFactory; //導入方法依賴的package包/類
/**
 * Metodo per muovere la mappa in una determinata posizione
 */
void muoviMappaConAnimazione(LatLng posizione) {
    CameraUpdate location = CameraUpdateFactory.newLatLngZoom(posizione, 16);
    mMappa.animateCamera(location);
}
 
開發者ID:IelloDevTeam,項目名稱:IelloAndroidAdminApp,代碼行數:8,代碼來源:MappaGoogle.java


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