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

无人久伴 提交于 2019-12-10 15:05:23

问题


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..


回答1:


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.




回答2:


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




回答3:


You should use an image view to show the image. That will show the image view of the desired place. And add further OnclickListener on the image for view 360 or zoom.



来源:https://stackoverflow.com/questions/16400483/trying-to-show-streetview-in-by-using-google-maps-android-api-v2-in-android-but

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!