当前位置: 首页>>代码示例>>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;未经允许,请勿转载。