本文主要是介绍webview下js的gps定位,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
webview下js的gps定位
<html>
<head><title>Js调用Android</title>
</head><body>
<input type="button" value="Toast提示" onclick="myObj.startGps();"/>
<input type="button" value="列表对话框" onclick="myObj.showDialog();"/>
<p id="demo">Click the button to get your coordinates:</p>
<button onclick="getLocation()">Try It</button>
<script>var x = document.getElementById("demo");//在android代码中调用此方法function showInfoFromJava(msg) {alert("来自客户端的信息:"+msg);}function getLocation() {console.info("getLocation working")if (navigator.geolocation) {navigator.geolocation.getCurrentPosition(showPosition,showError);} else {x.innerHTML = "Geolocation is not supported by thi
这篇关于webview下js的gps定位的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!