Trying to show StreetView in by using Google Maps Android API v2 in android but not able to get it working

Parth picture Parth · May 6, 2013 · Viewed 11.5k times · Source

I am trying since long time to show the StreetView of particular location in Android but unfortunately unable to succeed.

What i require is that if i provide a position(LAT,LONG) to the map it should show the streetview of that particular position.

Following is the working code that shows Map, 3D map, hybrid map, sattlatite view etc etc.. BUT not showing the STREETVIEW...

mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
    mMap.addMarker(new MarkerOptions().position(new LatLng(33.748832, -84.38751300000001)).title("Marker"));
    mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
    mMap.setTrafficEnabled(true);
    CameraPosition cameraPosition = new CameraPosition.Builder()
    .zoom(17)                   // Sets the zoom
    .target(new LatLng(33.748832, -84.38751300000001))
    .bearing(90)                // Sets the orientation of the camera to east
    .tilt(30)                   // Sets the tilt of the camera to 30 degrees
    .build();                   // Creates a CameraPosition from the builder
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

I just need is some way to show the StreetView..

Answer

MaciejGórski picture MaciejGórski · May 6, 2013

You can now use what are supported by play-service library.

https://developers.google.com/android/reference/com/google/android/gms/maps/StreetViewPanoramaFragment

https://developers.google.com/android/reference/com/google/android/gms/maps/StreetViewPanoramaView

You cannot embed streetview in your own app using Google Maps Android API v2.

You can:

  • run StreetView through Intent
  • try using javascript API v3 with WebView

Edit: note, this is now available on iOS, so may be available on Android in the future.