4

我試圖在很長一段時間內顯示Android中的特定位置的StreetView,但不幸無法成功。試圖在Android中使用Google Maps Android API v2顯示StreetView但無法使其工作

我需要的是,如果我向地圖提供一個位置(LAT,LONG),它應該顯示該特定位置的街景。

以下是工作的代碼,顯示地圖,3D地圖,混合地圖,sattlatite視圖等等等等。 但不顯示街景...

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)); 

我只是需要一些方式來展現StreetView ..

回答

6

您現在可以使用Play服務庫支持的內容。

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

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

在自己的應用程序中使用谷歌地圖API的Android V2你不能嵌入街景。

您可以:

  • 運行街景通過Intent
  • 嘗試使用JavaScript API V3與WebView

編輯:注意,這是現在可以在iOS上,因此可以提供在未來的Android上。

+0

好的謝謝你的回覆....讓我們嘗試通過INTENT,並讓所有人知道進程。 – Parth 2013-05-07 05:54:09

+0

我能夠這樣做...但現在我需要顯示一個popoer它plz按照我的新問題http://stackoverflow.com/questions/16418418/i-want-to-add-popover-overlay-hotspot -on最街景 - 的 - 谷歌地圖功能於安卓 – Parth 2013-05-07 12:30:48

0

您應該使用圖像視圖來顯示圖像。這將顯示所需位置的圖像視圖。並在圖像上添加更多的OnclickListener以進行視圖360或縮放。

相關問題