【问题标题】:Trying to show StreetView in by using Google Maps Android API v2 in android but not able to get it working尝试通过在 android 中使用 Google Maps Android API v2 来显示 StreetView 但无法使其正常工作
【发布时间】:2013-05-06 14:06:04
【问题描述】:

长期以来,我一直在尝试在 Android 中显示特定位置的街景,但不幸的是无法成功。

我需要的是,如果我向地图提供位置(纬度,经度),它应该显示该特定位置的街景。

以下是显示地图、3D 地图、混合地图、卫星视图等的工作代码。 但没有显示 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));

我只需要某种方式来显示街景。

【问题讨论】:

    标签: android google-maps google-maps-android-api-2 google-street-view


    【解决方案1】:

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

    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 将街景嵌入到您自己的应用中。

    你可以:

    • 通过Intent 运行街景视图
    • 尝试使用带有WebView的javascript API v3

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

    【讨论】:

    • 好的,谢谢您的回复....让我们通过INTENT尝试一下,让所有人都知道过程。
    • 我可以这样做......但现在我需要在上面显示一个 popoer 请关注我的新问题stackoverflow.com/questions/16418418/…
    【解决方案2】:

    由于 Google Play 服务 4.4.+ Streetview API 可用。在这里查看https://developers.google.com/maps/documentation/android/streetview

    【讨论】:

      【解决方案3】:

      您应该使用图像视图来显示图像。这将显示所需位置的图像视图。并在图像上添加更多 OnclickListener 以进行 360 度视图或缩放。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多