繁体   English   中英

在Android应用程序中显示静态Google Map位置

[英]Display static google map location in android application

这是我的代码,用于使用html在android应用程序中显示静态google地图,但是当我打开活动时它显示为空白。 请帮助我解决问题,我是android的新手,

JAVA

WebView overview = (WebView) findViewById(R.id.googlemap_webView);
        overview.loadUrl("file:///android_asset/content/googlelocation.html");  

googlelocation.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=Crescent%20Builders%2C%20Cherooty%20Road%2C%20Vellayil%2C%20Calicut%2C%20Kerala%2C%20India&key=AIzaSyCeBlSt-PVun7-08LrM6mIS5Nd0NCRVpDM"></iframe>
</body>
</html>

在最新版的Google Maps for Android中添加了静态地图。 参见https://developers.google.com/maps/documentation/android/lite

除非您有充分的理由使用网络版本,否则特定于Android的版本会更好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM