本文整理汇总了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);
}
}
示例2: setOnMapLoadedCallback
import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; //导入依赖的package包/类
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
map.setOnMapLoadedCallback(callback);
}
示例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));
}
}
}
示例4: setOnMapLoadedCallback
import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; //导入依赖的package包/类
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
map.setOnMapLoadedCallback(callback);
}