在尝试使用地理定位api时,我正在体验此错误:
This website does not have permission to use the Geolocation API奇怪的是,同一个网站在一个系统上运行良好(安装了IE9和I.E10 ),并在安装了i.9的系统上抛出错误。
我们在不同的系统上测试了它,但是它只在安装了I.E9的特定系统上引发错误。
码
function geolocateUser()
{
// If the browser supports the Geolocation API
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError);
}
else {
alert("Your browser doesn't support the Geolocation API");
}
}如果成功的话:
function geolocationSuccess(position) {
var userCurrentLatLong = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
}如有错误:
function geolocationError(positionError) {
alert(positionError.message + "\n" + "you will be redirected to default location.");
}发布于 2013-04-01 12:36:31
对于IE,请按照下面的说明:

发布于 2015-10-17 10:16:23
这可能是Windows设置,至少在我的情况下是这样的。尝试转到Settings (从Windows中的开始菜单中搜索)>隐私>位置,然后打开Location = On。
发布于 2018-04-17 19:33:11
对于Windows 10,在打开之前,您可能需要在设置>隐私>位置中打开“位置服务”。
https://stackoverflow.com/questions/15742997
复制相似问题