Trying to show StreetView using Google Maps Android API v2 in Android, but cannot get it working

I have been trying for a long time to show StreetView in a certain place on Android, but, unfortunately, it was not possible to succeed.

I need that if I provide a position (LAT, LONG) on the map, it should show a street representation of that particular position.

Below is the working code that displays the map, three-dimensional map, hybrid map, satellite view, etc. etc. BUT not showing the ARROW ...

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 to somehow show StreetView ..

+4
source share
3 answers

Now you can use what is supported by the game services 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 street views in your application using the Google Maps Android v2 API.

You can:

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

Edit: notice, now it is available on iOS, so in the future it will be available on Android.

+6
source

Since Google Play 4.4 services are available. + Streetview API. Check out https://developers.google.com/maps/documentation/android/streetview

+5
source

You must use the image to display the image. This will show the image in the right place. And add another OnclickListener to the image to view 360 or zoom.

0
source

Source: https://habr.com/ru/post/1479365/


All Articles