尝试在Android中使用Google Maps Android API v2显示StreetView,但无法使其正常工作

Par*_*rth 5 android google-maps google-street-view google-maps-android-api-2

我很长时间以来在Android中显示特定位置的StreetView,但遗憾的是无法成功.

我需要的是,如果我向地图提供一个位置(LAT,LONG),它应该显示该特定位置的街景.

以下是显示地图,3D地图,混合地图,sattlatite视图等的工作代码.但是没有显示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));
Run Code Online (Sandbox Code Playgroud)

我只需要一些方法来显示StreetView ..

Mac*_*ski 7

您现在可以使用播放服务库支持的内容.

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

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

您无法使用Google Maps Android API v2在自己的应用中嵌入街景.

您可以:

  • 运行StreetView Intent
  • 尝试使用javascript API v3 WebView

编辑:注意,现在可以在iOS上使用,因此将来可能会在Android上提供.


Mic*_*hal 5

由于Google Play服务4.4.+ Streetview API可用.点击此处https://developers.google.com/maps/documentation/android/streetview