【发布时间】:2016-08-03 03:09:48
【问题描述】:
我有一个aspx页面,已经集成了google map api并且可以显示google map,然后我想在android webview中显示,但是webview不能显示google map。 这个aspx页面可以在android浏览器中完美运行。
这里是 Logcat 打印:
I / chromium: [INFO: CONSOLE (210)] "Google Maps API 警告:NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys",来源:http://maps.google.com/maps-api-v3/api/js/25 /11/util.js (210)
I / chromium: [INFO: CONSOLE (210)] "Google Maps API 警告:SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required",来源:http://maps.google.com/maps-api-v3/api/js/25 /11/util.js (210)
这里是设置webview的代码:
webView.getSettings().setJavaScriptEnabled(true);//
webView.getSettings().setGeolocationEnabled(true);//
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setDomStorageEnabled(true);//
webView.getSettings().setDatabaseEnabled(true);//
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
webView.getSettings().setBlockNetworkImage(false);
webView.getSettings().setBlockNetworkLoads(false);
String dir = this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
webView.getSettings().setGeolocationDatabasePath(dir);
【问题讨论】:
-
我也面临同样的问题,如果你有任何解决方案,请告诉我。
标签: android google-maps webview