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

项目:Android-Wear-Projects    文件:StreetView.java   
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_street_view);

    SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
            (SupportStreetViewPanoramaFragment)
                    getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);

    streetViewPanoramaFragment.getStreetViewPanoramaAsync(
            new OnStreetViewPanoramaReadyCallback() {
                @Override
                public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
                    // Only set the panorama to SYDNEY on startup (when no panoramas have been
                    // loaded which is when the savedInstanceState is null).
                    if (savedInstanceState == null) {
                        panorama.setPosition(SYDNEY);
                    }
                }
            });
}
项目:android-OurStreets    文件:StreetViewFragment.java   
private void setUpStreetViewPanoramaIfNeeded(final LatLng location) {
    mMapFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
        @Override
        public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
            if (streetViewPanorama != null) {
                streetViewPanorama.setPosition(location);
                streetViewPanorama.setUserNavigationEnabled(true);
                streetViewPanorama.setPanningGesturesEnabled(true);
                streetViewPanorama.setZoomGesturesEnabled(true);

                StreetViewPanoramaCamera galleryOrientation = StreetViewPanoramaCamera.
                        builder(streetViewPanorama.getPanoramaCamera())
                        .bearing(mDetail.getBearing())
                        .tilt(mDetail.getTilt())
                        .build();
                streetViewPanorama.animateTo(galleryOrientation, TimeUnit.SECONDS.toMillis(1));
            }
        }
    });
}
项目:android-OurStreets    文件:StreetViewFragment.java   
private void initMapFragment() {
    mMapFragment = SupportStreetViewPanoramaFragment.newInstance();
    mMapFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
        @Override
        public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
            setUpStreetViewPanoramaIfNeeded(mDetail.getPosition());
        }
    });
}
项目:RxGoogleMapsBinding    文件:StreetViewPanoramaFragmentPanoramaReadyOnSubscribe.java   
@Override public void call(final Subscriber<? super StreetViewPanorama> subscriber) {
  OnStreetViewPanoramaReadyCallback callback = new OnStreetViewPanoramaReadyCallback() {
    @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
      if (!subscriber.isUnsubscribed()) {
        subscriber.onNext(streetViewPanorama);
      }
    }
  };

  fragment.getStreetViewPanoramaAsync(callback);
}
项目:RxGoogleMapsBinding    文件:StreetViewPanoramaViewPanoramaReadyOnSubscribe.java   
@Override public void call(final Subscriber<? super StreetViewPanorama> subscriber) {
  OnStreetViewPanoramaReadyCallback callback = new OnStreetViewPanoramaReadyCallback() {
    @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
      if (!subscriber.isUnsubscribed()) {
        subscriber.onNext(streetViewPanorama);
      }
    }
  };

  view.getStreetViewPanoramaAsync(callback);
}
项目:RxGoogleMapsBinding    文件:StreetViewPanoramaSupportFragmentPanoramaReadyOnSubscribe.java   
@Override public void call(final Subscriber<? super StreetViewPanorama> subscriber) {
  OnStreetViewPanoramaReadyCallback callback = new OnStreetViewPanoramaReadyCallback() {
    @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
      if (!subscriber.isUnsubscribed()) {
        subscriber.onNext(streetViewPanorama);
      }
    }
  };

  fragment.getStreetViewPanoramaAsync(callback);
}
项目:tiempobus    文件:StreetViewActivity.java   
private void initSVFragment(final Bundle savedInstanceState) {

        mSvpFragment = ((SupportStreetViewPanoramaFragment) getSupportFragmentManager()
                .findFragmentById(R.id.streetviewpanorama));
        mSvpFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
            @Override
            public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
                setUpStreetViewPanoramaIfNeeded(savedInstanceState, coordenadas);
            }
        });

    }
项目:tiempobus    文件:StreetViewActivity.java   
/**
 * StreetView
 *
 * @param savedInstanceState
 */
private void setUpStreetViewPanoramaIfNeeded(final Bundle savedInstanceState, final LatLng coordenadas) {


    mSvpFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
        @Override
        public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {

            if (streetViewPanorama != null && savedInstanceState == null) {

                streetViewPanorama.setPosition(coordenadas);
                streetViewPanorama.setUserNavigationEnabled(true);
                streetViewPanorama.setPanningGesturesEnabled(true);
                streetViewPanorama.setZoomGesturesEnabled(true);

                Log.d("STREETVIEW", "coordenadas 2: " + coordenadas.latitude + " - " + coordenadas.longitude);


            }

        }
    });


}