Hide

StreetViewPanoramaView

public class StreetViewPanoramaView extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.google.android.gms.maps.StreetViewPanoramaView

A View which displays a Street View panorama (with data obtained from the Google Maps service). When focused, it will capture keypresses and touch gestures to move the panorama.

Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. In particular, you must forward the following methods:

A StreetViewPanorama must be acquired using getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback). The StreetViewPanoramaView automatically initializes the Street View system and the view.

For a simpler method of displaying a StreetViewPanorama use StreetViewPanoramaFragment (or SupportStreetViewPanoramaFragment) if you are looking to target earlier platforms.

Note: You are advised not to add children to this view.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

StreetViewPanoramaView(Context context, AttributeSet attrs, int defStyle)

Public Method Summary

final StreetViewPanorama
getStreetViewPanorama()
This method is deprecated. Use getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback) instead. The callback method provides you with a StreetViewPanorama instance guaranteed to be non-null and ready to be used.
void
final void
onCreate(Bundle savedInstanceState)
final void
final void
final void
final void
final void

Public Constructors

public StreetViewPanoramaView (Context context)

public StreetViewPanoramaView (Context context, AttributeSet attrs)

public StreetViewPanoramaView (Context context, AttributeSet attrs, int defStyle)

public StreetViewPanoramaView (Context context, StreetViewPanoramaOptions options)

Public Methods

public final StreetViewPanorama getStreetViewPanorama ()

This method is deprecated.
Use getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback) instead. The callback method provides you with a StreetViewPanorama instance guaranteed to be non-null and ready to be used.

Gets the underlying StreetViewPanorama that is tied to this view.

Returns
  • the StreetViewPanorama. Null if the view is not yet ready. This can happen when Google Play services is not available. If Google Play services becomes available afterwards, calling this method again will initialize and return the panorama.

public void getStreetViewPanoramaAsync (OnStreetViewPanoramaReadyCallback callback)

Sets a callback object which will be triggered when the StreetViewPanorama instance is ready to be used.

Note that:

  • In the case where Google Play services is not installed on the user's device, the callback will not be triggered until the user installs it.
  • The callback will be executed in the main thread.
  • The StreetViewPanorama object provided by the callback is non-null.

Parameters
callback The callback object that will be triggered when the panorama is ready to be used.

public final void onCreate (Bundle savedInstanceState)

You must call this method from the parent Activity/Fragment's corresponding method.

public final void onDestroy ()

You must call this method from the parent Activity/Fragment's corresponding method.

public final void onLowMemory ()

You must call this method from the parent Activity/Fragment's corresponding method.

public final void onPause ()

You must call this method from the parent Activity/Fragment's corresponding method.

public final void onResume ()

You must call this method from the parent Activity/Fragment's corresponding method.

public final void onSaveInstanceState (Bundle outState)

You must call this method from the parent Activity/Fragment's corresponding method.