问题描述
有没有人需要处理,并设法找到一个可行的解决方法,我发布在下面的错误报告中的Firefox 5地理定位问题。链接到报告比在这里重新描述要容易。
当然,我不是只有一个人在这个星球上被咬了。
我可能有点迟,但希望我能帮助别人。
我的解决方法是基于延迟的调用。如果在延迟的调用触发时没有修复,我会变得可疑:)
pre $ var timeIsPassig = false;
函数anyThing(){
timeIsPassig = true;
setTimeout(
function(){
if(timeIsPassig){
timeIsPassig = false;
console.log(Waiting too much ... or you say不是现在?:-P);
}
},
10000
);
navigator.geolocation.getCurrentPosition(
function(pos){timeIsPassig = false; / * rest of positioning * /},
function(err){timeIsPassig = false; / * rest of error处理* /},
{maximumAge:30000,timeout:10000,enableHighAccuracy:true}
)
}
Has anyone out there had to deal with and managed to find a viable workaround for the Firefox 5 geolocation issue I posted in the following bug report. It's easier to link to the report than re-describe it here.
https://bugzilla.mozilla.org/show_bug.cgi?id=675533
Surely I'm not the only one on the planet this has bitten.
I might be a bit late but hope I can help others.My workaround is based on a delayed call. If there is no fix when the delayed call is fires, I become suspicious :)
var timeIsPassig = false;
function anyThing(){
timeIsPassig = true;
setTimeout(
function(){
if (timeIsPassig) {
timeIsPassig = false;
console.log("Waiting too much... Or did you say not now? :-P");
}
},
10000
);
navigator.geolocation.getCurrentPosition(
function (pos) {timeIsPassig = false; /* rest of positioning*/},
function (err) {timeIsPassig = false; /* rest of error handling*/},
{maximumAge: 30000, timeout: 10000, enableHighAccuracy: true}
)
}
这篇关于Firefox 5,地理定位和“不是现在”问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!