如何获取街景图全景图像数据,Android

时间:2018-10-24 04:13:10

标签: android google-cardboard google-street-view

如何获取Android的街景全景图像数据,我想将街景图像数据传递到另一个Java文件的硬纸板视图中,然后硬纸板将加载图像数据并显示它。谁能帮我?谢谢。

public class MainActivity extends AppCompatActivity {
private static final LatLng SYDNEY = new LatLng(-33.87365, 151.20689);

private VrPanoramaView panoWidgetView;

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
            (SupportStreetViewPanoramaFragment)
                    getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
    streetViewPanoramaFragment.getStreetViewPanoramaAsync( 
            new OnStreetViewPanoramaReadyCallback() {
                @Override
                public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
                    // Only set the panorama to SYDNEY on startup (when no panoramas have been
                    // loaded which is when the savedInstanceState is null).
                    if (savedInstanceState == null) {
                        panorama.setPosition(SYDNEY);

                    }
                }
            });
}

}

0 个答案:

没有答案