Navigator.geolocation支持在web服务器中 [英] navigator.geolocation support in web server
问题描述
这是我第一次给stackoverflow提问,因为我找不到答案。
我最近有3台主机(如果可以提的话) :
- Hostgat **。com
- inmotionhost ***。com $
- Hostgat**.com
- inmotionhost***.com
- ipag*.com
$ b $这是基本的代码
if(navigator&& navigator.geolocation){
navigator.geolocation.getCurrentPosition(
function(pos){
if (is_echo){return;}
is_echo = true;
success(pos.coords.latitude,pos.coords.longitude);
},
function(){
if(is_echo){return;}
is_echo = true;
fail();
}
);
} else {
fail();
这段代码有几个反馈:第一和第二部作品中的
。 (确定启用gps的android galaxy选项卡)
为什么第三次不起作用。 (在启用gps的android galaxy选项卡上总是失败)
导航器是否需要php mod mod_geoip2 ?
如果是这样,我有搜索hostgat **。com不支持共享。
为什么工作。对于混乱的问题,我很抱歉,我都是新的地理定位。
谢谢你的stackoverflow为我们提供了...优秀的样本......
Luckman R
解决方案
if(navigator&& navigator.geolocation){
navigator。 geolocation.getCurrentPosition(
函数(pos){
if(is_echo){return;}
is_echo = true;
成功(pos.coords.latitude,pos.coords.longitude );
},
function(){
if(is_echo){return;}
is_echo = true;
fail();
}, {
enableHighAccuracy:true
,timeout:5000
}
);
} else {
fail();
$ / code>
安卓设备的地理位置有一些问题,与此代码我已经添加两行可能工作..如果不回复..
this is my first time to give question on stackoverflow , because I can't find the answer..
I recently have 3 host (if ok to mention ) :
-- this is the basic code
if(navigator && navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function(pos) {
if (is_echo){ return; }
is_echo = true;
success(pos.coords.latitude,pos.coords.longitude);
},
function() {
if (is_echo){ return; }
is_echo = true;
fail();
}
);
} else {
fail();
}
This code has several feedback:
in first and second works. (ok with android galaxy tab with gps enabled )
Why on third does not work. (always fail in android galaxy tab with gps enabled)
Is navigator require php mod mod_geoip2
if so , I have search that hostgat**.com does not support it in shared.
why working. I am sorry for messy question, I am all new in geolocation.
Thank you for stackoverflow has provide us with ... excellent samples...
Luckman R
解决方案 if(navigator && navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function(pos) {
if (is_echo){ return; }
is_echo = true;
success(pos.coords.latitude,pos.coords.longitude);
},
function() {
if (is_echo){ return; }
is_echo = true;
fail();
},{
enableHighAccuracy: true
,timeout : 5000
}
);
} else {
fail();
}
Hi,
Geolocation with android devices have some problem always just try with this code i have added two lines might work..if not reply back..
这篇关于Navigator.geolocation支持在web服务器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!