gpt4 book ai didi

android - 如何将 streetView 放入 android 的 webView 中?

转载 作者:行者123 更新时间:2023-11-29 01:40:34 25 4
gpt4 key购买 nike

我想把街景放在 webView 中。看起来像 this但只有街景。任何想法?我希望有人能帮助我。

最佳答案

使用此代码,您可以在 WebView 中插入街景。您的网址必须是本示例中的 iframe。您可以更改 iframe 大小。

WebView web = (WebView) findViewById(R.id.web);
web.getSettings().setJavaScriptEnabled(true);
String streetWeb = "<iframe src=\"https://www.google.com/maps/embed?pb=!1m0!3m2!1ses!2ses!4v1475148094565!6m8!1m7!1sF%3A-k265GybRcAQ%2FVH3MDcB3A9I%2FAAAAAAAAQTY%2FXZMeIk5IpDsLeewR7wwFhtS5wd6YqB9Gg!2m2!1d48.872337!2d2.777252!3f307.8785102665392!4f18.611126537609977!5f0.5032736111351279\" width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\" allowfullscreen></iframe>";
web.loadData(streetWeb, "text/html", null);

关于android - 如何将 streetView 放入 android 的 webView 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24937749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com