我使用google play services全景显示全景图像。 一切正常,但我想在该视图的顶部添加一个布局,以便将图像用作活动背景。
这是我展示全景视图的代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mClient = new GoogleApiClient.Builder(this, this, this)
.addApi(Panorama.API)
.build();
}
@Override
public void onConnected(Bundle bundle) {
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.pano1);
Panorama.PanoramaApi.loadPanoramaInfo(mClient, uri).setResultCallback(
new ResultCallback<PanoramaApi.PanoramaResult>() {
@Override
public void onResult(PanoramaApi.PanoramaResult result) {
if (result.getStatus().isSuccess()) {
Intent viewerIntent = result.getViewerIntent();
Log.i(TAG, "found viewerIntent: " + viewerIntent);
if (viewerIntent != null) {
startActivity(viewerIntent);
}
} else {
Log.e(TAG, "error: " + result);
}
}
});
}
工作流程是我使用ViewerIntent开始新活动而我没有布局控制,所以它只显示全景视图。
我正在搜索以下其中一项:
Google街景全景活动示例:
答案 0 :(得分:0)
Google API中的Panorama API似乎没有您正在寻找的那么多功能。基于PanoramaResult(getViewerIntent
)的返回描述,
如果图像是全景图像,则该图像不为空,并在启动时启动查看器。如果图像不是全景图,则该图像将为空。
您可能需要搜索第三方库或根据您需要创建自己的实施。