Java 类com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback 实例源码

项目:XamarinAdmobTutorial    文件:SnapshotDemoActivity.java   
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);
    }
}
项目:HereAStory-Android    文件:SnapshotDemoActivity.java   
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);
    }
}
项目:referendum_1o_android    文件:GoogleMapWrapper.java   
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
    map.setOnMapLoadedCallback(callback);
}
项目:TravelTracker    文件:SelectLocationActivity.java   
@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));
        }
    }
}
项目:HereAStory-Android    文件:GoogleMapWrapper.java   
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
    map.setOnMapLoadedCallback(callback);
}
项目:mtransit-for-android    文件:GoogleMapWrapper.java   
@Override
public void setOnMapLoadedCallback(OnMapLoadedCallback callback) {
    map.setOnMapLoadedCallback(callback);
}