jjzjj

getCurrentPosition

全部标签

html - geoLocation.GetCurrentPosition 在 IE 11 中总是失败

下面的脚本在FireFox和Chrome中运行良好,但在InternetExplorer11中,它总是失败(POSITION_UNAVAILABLE)。我已将浏览器设置为允许位置请求,并且我同意请求权限时浏览器向我显示的提示。我几乎可以肯定,几个月前当我最后一次试验它时,它运行良好。就IE的设置而言,我可能缺少什么?$(document).ready(function(){if(Modernizr.geolocation){navigator.geolocation.getCurrentPosition(positionSuccess,positionError,{enableHigh

html - geoLocation.GetCurrentPosition 在 IE 11 中总是失败

下面的脚本在FireFox和Chrome中运行良好,但在InternetExplorer11中,它总是失败(POSITION_UNAVAILABLE)。我已将浏览器设置为允许位置请求,并且我同意请求权限时浏览器向我显示的提示。我几乎可以肯定,几个月前当我最后一次试验它时,它运行良好。就IE的设置而言,我可能缺少什么?$(document).ready(function(){if(Modernizr.geolocation){navigator.geolocation.getCurrentPosition(positionSuccess,positionError,{enableHigh

html - navigator.geolocation.getCurrentPosition 回调在 Firefox 10 上不起作用

我正在构建一个使用GeolocationAPI的应用程序。我似乎无法获得一段非常简单的代码来在Firefox10上工作。这是代码:window.onload=function(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(position){alert('itworks');},function(error){alert('Erroroccurred.Errorcode:'+error.code);});}else{alert('nogeolocationsupport');}

html - navigator.geolocation.getCurrentPosition 回调在 Firefox 10 上不起作用

我正在构建一个使用GeolocationAPI的应用程序。我似乎无法获得一段非常简单的代码来在Firefox10上工作。这是代码:window.onload=function(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(position){alert('itworks');},function(error){alert('Erroroccurred.Errorcode:'+error.code);});}else{alert('nogeolocationsupport');}

javascript - getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用

我在请求用户提供地理位置数据的网站上遇到此错误:getCurrentPosition()andwatchPosition()aredeprecatedoninsecureorigins,andsupportwillberemovedinthefuture.Youshouldconsiderswitchingyourapplicationtoasecureorigin,suchasHTTPS.Seegoo.gl/rStTGzformoredetails.我的意思是它基本上只是一个通知,谷歌链接只是说它被弃用了。我没有将我的网站迁移到SSL的计划...那么对于像我这样的人有替代方案吗?

javascript - getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用

我在请求用户提供地理位置数据的网站上遇到此错误:getCurrentPosition()andwatchPosition()aredeprecatedoninsecureorigins,andsupportwillberemovedinthefuture.Youshouldconsiderswitchingyourapplicationtoasecureorigin,suchasHTTPS.Seegoo.gl/rStTGzformoredetails.我的意思是它基本上只是一个通知,谷歌链接只是说它被弃用了。我没有将我的网站迁移到SSL的计划...那么对于像我这样的人有替代方案吗?

android - React-native android忽略navigator.geolocation.getCurrentPosition

我正在尝试在我的Android设备(PhilipsXenium)上使用navigator.geolocation.getCurrentPosition。它在iphone和genimotion模拟器中完全可以正常工作。navigator.geolocation.getCurrentPosition绝对不返回任何内容-没有错误,没有成功。但是,如果我在智能手机中关闭地理定位服务,它会返回Noavailablelocationprovider。另外,navigator.geolocation.watchPosition工作正常。 最佳答案

android - React-native android忽略navigator.geolocation.getCurrentPosition

我正在尝试在我的Android设备(PhilipsXenium)上使用navigator.geolocation.getCurrentPosition。它在iphone和genimotion模拟器中完全可以正常工作。navigator.geolocation.getCurrentPosition绝对不返回任何内容-没有错误,没有成功。但是,如果我在智能手机中关闭地理定位服务,它会返回Noavailablelocationprovider。另外,navigator.geolocation.watchPosition工作正常。 最佳答案

javascript - navigator.geolocation.getCurrentPosition 在 android google chrome 上不起作用

这段代码:navigator.geolocation.getCurrentPosition(function(position){alert(position.coords.latitude,position.coords.longitude);},function(error){alert(error.message);},{enableHighAccuracy:true,timeout:5000});https://jsfiddle.net/FcRpM/在我的笔记本电脑上的GoogleChrome中工作,但在移动HTConeS上工作(Android4.1,GPS关闭,通过移动网络定

javascript - navigator.geolocation.getCurrentPosition 在 android google chrome 上不起作用

这段代码:navigator.geolocation.getCurrentPosition(function(position){alert(position.coords.latitude,position.coords.longitude);},function(error){alert(error.message);},{enableHighAccuracy:true,timeout:5000});https://jsfiddle.net/FcRpM/在我的笔记本电脑上的GoogleChrome中工作,但在移动HTConeS上工作(Android4.1,GPS关闭,通过移动网络定