当前位置: 首页>>代码示例>>Java>>正文


Java OnMapLoadedCallback类代码示例

本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback的典型用法代码示例。如果您正苦于以下问题:Java OnMapLoadedCallback类的具体用法?Java OnMapLoadedCallback怎么用?Java OnMapLoadedCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnMapLoadedCallback类属于com.google.android.gms.maps.GoogleMap包,在下文中一共展示了OnMapLoadedCallback类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: takeSnapshot

import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; //导入依赖的package包/类
private void takeSnapshot() {
    if (mMap == null) {
        return;
    }

    final ImageView snapshotHolder = (ImageView) findViewById(R.id.snapshot_holder);

    final SnapshotReadyCallback callback = new SnapshotReadyCallback() {
        @Override
        public void onSnapshotReady(Bitmap snapshot) {
            // Callback is called from the main thread, so we can modify the ImageView safely.
            snapshotHolder.setImageBitmap(snapshot);
        }
    };

    if (mWaitForMapLoadCheckBox.isChecked()) {
        mMap.setOnMapLoadedCallback(new OnMapLoadedCallback() {
            @Override
            public void onMapLoaded() {
                mMap.snapshot(callback);
            }
        });
    } else {
        mMap.snapshot(callback);
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:27,代码来源:SnapshotDemoActivity.java

示例2: setOnMapLoadedCallback

import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; //导入依赖的package包/类
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
    map.setOnMapLoadedCallback(callback);
}
 
开发者ID:mosquitolabs,项目名称:referendum_1o_android,代码行数:5,代码来源:GoogleMapWrapper.java

示例3: onCreate

import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    getActionBar().setDisplayHomeAsUpEnabled(true);
    setContentView(R.layout.select_location_activity);
    
    // Set up map
    GoogleMap map = getMap();
    map.setOnMapClickListener(new LocationSelectedListener());
    map.setOnMapLoadedCallback(new OnMapLoadedCallback() {
        @Override
        public void onMapLoaded() {
            String msg = getString(R.string.select_location_tap_to_select_location);
            Toast.makeText(SelectLocationActivity.this, msg, Toast.LENGTH_LONG).show();
        }
    });
    
    UiSettings settings = map.getUiSettings();
    settings.setMapToolbarEnabled(false);
    settings.setZoomControlsEnabled(true);
    settings.setZoomGesturesEnabled(true);
    settings.setScrollGesturesEnabled(true);
    
    // Get bundle data
    Bundle bundle = getIntent().getExtras();
    
    if (bundle != null) {
        Double startLat = bundle.getDouble(START_LAT, Double.NaN);
        Double startLng = bundle.getDouble(START_LNG, Double.NaN);
        
        // Zoom in to and mark the current position
        if (!startLat.isNaN() && !startLng.isNaN()) {
            LatLng position = new LatLng(startLat, startLng);
            
            map.moveCamera(CameraUpdateFactory.newLatLngZoom(position, zoomLevel));
            map.addMarker(new MarkerOptions()
                    .position(position));
        }
    }
}
 
开发者ID:TravelTracker,项目名称:TravelTracker,代码行数:42,代码来源:SelectLocationActivity.java

示例4: setOnMapLoadedCallback

import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; //导入依赖的package包/类
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
	map.setOnMapLoadedCallback(callback);
}
 
开发者ID:mtransitapps,项目名称:mtransit-for-android,代码行数:5,代码来源:GoogleMapWrapper.java


注:本文中的com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。