我必须在a中检索用户的位置WebView.我使用以下Javascript执行此操作:
function getLocation() {
navigator.geolocation.getCurrentPosition(displayLocation, handleError);
}
Run Code Online (Sandbox Code Playgroud)
但是权限请求弹出窗口永远不会打开.
我设置了这些设置:
ws.setJavaScriptEnabled(true);
ws.setGeolocationEnabled(true);
ws.setJavaScriptCanOpenWindowsAutomatically(true);
Run Code Online (Sandbox Code Playgroud)
从一个位置访问用户位置的正确方法是WebView什么?
我有一个基于webview的应用程序,当我访问http://maps.google.com时,我的webview没有像Safari那样传递该位置.我知道需要CLLocationManager,但是当网页(maps.google.com)想要访问我的设备位置时,我会收到回调吗?如何从WebView回复网页的坐标?