Navigator.geolocation支持在web服务器中 [英] navigator.geolocation support in web server

查看:137
本文介绍了Navigator.geolocation支持在web服务器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次给stackoverflow提问,因为我找不到答案。

我最近有3台主机(如果可以提的话) :


  1. Hostgat **。com

  2. inmotionhost ***。com
  3. $


    $ 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 ) :

    1. Hostgat**.com
    2. inmotionhost***.com
    3. ipag*.com

    -- 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆