我使用GPS_PROVIDER可以获得位置信息。不过就是慢了点,而且室内无法获取。
但我使用NETWORK_PROVIDER就无法获得位置信息。
通过http://www.google.com/loc/json获得GSM位置信息也无效!
求高手解答!

解决方案 »

  1.   

    我的请求数据:{
    "address_language":"zh_CN",
    "wifi_towers":[
    {"mac_address":"00-1f-33-7b-a4-ef","signal_strength":-81,"ssid":"ChinaNet","age":0},
    {"mac_address":"28-93-fe-c5-b3-80","signal_strength":-61,"ssid":"wrv210-new8511f","age":0},
    {"mac_address":"4c-e6-76-46-8f-c6","signal_strength":-68,"ssid":"new851-east","age":0},
    {"mac_address":"06-1f-33-7b-a4-cf","signal_strength":-76,"ssid":"NETGEAR - 1","age":0},
    {"mac_address":"06-1f-33-7b-a4-ef","signal_strength":-88,"ssid":"NETGEAR - 1","age":0},
    {"mac_address":"00-1f-33-7b-a5-07","signal_strength":-91,"ssid":"ChinaNet","age":0},
    {"mac_address":"06-1f-33-7b-a5-07","signal_strength":-92,"ssid":"NETGEAR - 1","age":0},
    {"mac_address":"00-13-46-40-36-ec","signal_strength":-93,"ssid":"new851-2f","age":0}
    ],
    "request_address":true,
    "cell_towers":[
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-111,"cell_id":"19173","mobile_network_code":0,"age":0},
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-107,"cell_id":"1612463645","mobile_network_code":0,"age":0},
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-103,"cell_id":"1612448975","mobile_network_code":0,"age":0},
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-99,"cell_id":"1612463648","mobile_network_code":0,"age":0},
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-95,"cell_id":"1612448978","mobile_network_code":0,"age":0},
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-91,"cell_id":"1612466915","mobile_network_code":0,"age":0},
    {"mobile_country_code":460,"location_area_code":24604,"signal_strength":-87,"cell_id":"1612450296","mobile_network_code":0,"age":0}
    ],
    "carrier":"HTC",
    "host":"maps.google.com",
    "version":"1.1.0",
    "radio_type":"gsm"
    }
    标准的请求数据:{   "version": "1.1.0",   "host": "maps.google.com",   "home_mobile_country_code": 310,   "home_mobile_network_code": 410,   "radio_type": "gsm",   "carrier": "Vodafone",   "request_address": true,   "address_language": "en_GB",   "location": {     "latitude": 51.0,     "longitude": -0.1   },   "cell_towers": [     {       "cell_id": "42",       "location_area_code": 415,       "mobile_country_code": 310,       "mobile_network_code": 410,       "age": 0,       "signal_strength": -60,       "timing_advance": 5555     },     {       "cell_id": "88",       "location_area_code": 415,       "mobile_country_code": 310,       "mobile_network_code": 580,       "age": 0,       "signal_strength": -70,       "timing_advance": 7777     }   ],   "wifi_towers": [     {       "mac_address": "01-23-45-67-89-ab",       "signal_strength": 8,       "age": 0     },     {       "mac_address": "01-23-45-67-89-ac",       "signal_strength": 4,       "age": 0     }   ] }
      

  2.   

    然后返回给我一个错误数据:可返回结果就是不正确:
    [code=HTML]
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />\r\n<title>������-��ҳ</title>\r\n<link href="/v30/css/site.css" rel="stylesheet" type="text/css" />\r\n</head>\r\n<body>\r\n<div id="shouye">\r\n\t<div class="top">\r\n\t\t<div class="top_01"></div>\r\n\t\t<div class="top_06"></div>\r\n\t\t<div class="top_03"></div>\r\n\t\t<div class="top_04_1">\r\n\t\t\t<ul class="daoh">\r\n\t\t\t\t<li class="daoh_1_b">��ҳ</li>\r\n\t\t\t\t<li class="daoh_2"><a href="/v30/intro.jsp">��Ʒ���ʷ�</a></li>\r\n\t\t\t\t<li class="daoh_3"><a href="http://wlan.vnet.cn" target="_blank">�ź�����</a></li>\r\n\t\t\t\t<li class="daoh_4"><a href="/v30/userGuid.jsp">ʹ��ָ��</a></li>\r\n\t\t\t\t<li class="daoh_5"><a href="http://www.fj.ct10000.com" target="_blank">����Ӫҵ��</a></li>\r\n\t\t\t\t<li class="daoh_6"><a href="/v30/questions.jsp">��������</a></li>\r\n\t\t\t\t<li class="daoh_7"><a href="/v30/download.jsp">�������</a></li>\r\n\t\t\t\t<li class="daoh_8"><a href="/v30/roaming.jsp" target="_blank" style="text-decoration:underline; ">Global Roaming</a></li>\r\n\t\t\t</ul>\r\n\t\t</div>\r\n\t\t<div class="top_05"></div>\r\n\t</div>\r\n\t<div class="wi">\r\n\t\t<div class="wi_01"></div>\r\n\t\t<div class="wi_05"></div>\r\n\t\t<div class="wi_03"></div>\r\n\t\t<div class="wi_04"></div>\r\n\t</div>\r\n\t<div class="xia">\r\n\t\t<iframe width="1006" height="293" scrolling=No frameborder=0 marginheight=0 marginwidth=0 src="/v30/cdmaContainer.jsp" allowtransparency="true"></iframe>\r\n\t</div>\r\n\t<div class="t_a"><img src="/v30/images/bottom.jpg"></div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\t\r\n\r\n\r\n\t<!--Promotion floating area before:Sat Dec 31 00:00:00 CST 2011-->\r\n\t<script type="text/javascript">\r\n\t\t//clickClose---begin----\r\n\t\tfunction hidead(){\r\n\t\t\tdocument.getElementById("floatAd").style.display="none";\r\n\t\t}\r\n\t\t//clickClose---end----\r\n\t\tfunction floatAD() {\r\n\t\t\tvar L=T=0\r\n\t\t\tvar R= document.body.clientWidth-obj.offsetWidth\r\n\t\t\tvar B = document.body.clientHeight-obj.offsetHeight\r\n\t\t\tobj.style.left = x + document.body.scrollLeft\r\n\t\t\tobj.style.top = y + document.body.scrollTop\r\n\t\t\tx = x + step*(xin?1:-1)\r\n\t\t\tif (x < L) { xin = true; x = L}\r\n\t\t\tif (x > R){ xin = false; x = R}\r\n\t\t\ty = y + step*(yin?1:-1)\r\n\t\t\tif (y < T) { yin = true; y = T }\r\n\t\t\tif (y > B) { yin = false; y = B }\r\n\t\t}\r\n\t</script>\r\n\r\n\t<table width="330" height="177" border="0" cellpadding="0" cellspacing="0" id="floatAd" style="position:absolute;overflow:hidden; ">\r\n\t\t<tr height="29">\r\n\t\t\t<td width="330" height="29" background="/floatAD/images/title.jpg">\r\n\t\t\t\t<div onclick="hidead();" style="float:right;margin-right:5px;cursor:pointer;margin-top:0px;display:inline;">\r\n\t\t\t\t\t<img src="/floatAD/images/1.jpg" border="0"/>\r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr height="148">\r\n\t\t\t<a href="http://sh.ct10000.com/v3/workbench/tyt/tytExplain.jsp" target="_blank"><td style="cursor:pointer;background-image:url(/floatAD/images/cardAD.jpg);"></td></a>\r\n\t\t</tr>\r\n\t</table>\r\n\t<script type="text/javascript">\r\n\t//float---begin---\r\n\t\tvar x = 50,y = 60\r\n\t\tvar xin = true, yin = true\r\n\t\tvar step = 1\r\n\t\tvar delay = 1\r\n\t\tvar obj=document.getElementById("floatAd")\r\n\t\tvar itl= setInterval("floatAD()", delay)\r\n\t\tobj.onmouseover=function(){clearInterval(itl)}\r\n\t\tobj.onmouseout=function(){itl=setInterval("floatAD()", delay)}\r\n\t//float---end---\r\n\t</script>\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n</body>\r\n</html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>������-��ҳ</title>
    <link href="/v30/css/site.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="shouye">
    <div class="top">
    <div class="top_01"></div>
    <div class="top_06"></div>
    <div class="top_03"></div>
    <div class="top_04_1">
    <ul class="daoh">
    <li class="daoh_1_b">��ҳ</li>
    <li class="daoh_2"><a href="/v30/intro.jsp">��Ʒ���ʷ�</a></li>
    <li class="daoh_3"><a href="http://wlan.vnet.cn" target="_blank">�ź�����</a></li>
    <li class="daoh_4"><a href="/v30/userGuid.jsp">ʹ��ָ��</a></li>
    <li class="daoh_5"><a href="http://www.fj.ct10000.com" target="_blank">����Ӫҵ��</a></li>
    <li class="daoh_6"><a href="/v30/questions.jsp">��������</a></li>
    <li class="daoh_7"><a href="/v30/download.jsp">�������</a></li>
    <li class="daoh_8"><a href="/v30/roaming.jsp" target="_blank" style="text-decoration:underline; ">Global Roaming</a></li>
    </ul>
    </div>
    <div class="top_05"></div>
    </div>
    <div class="wi">
    <div class="wi_01"></div>
    <div class="wi_05"></div>
    <div class="wi_03"></div>
    <div class="wi_04"></div>
    </div>
    <div class="xia">
    <iframe width="1006" height="293" scrolling=No frameborder=0 marginheight=0 marginwidth=0 src="/v30/cdmaContainer.jsp" allowtransparency="true"></iframe>
    </div>
    <div class="t_a"><img src="/v30/images/bottom.jpg"></div>
    </div>

    <!--Promotion floating area before:Sat Dec 31 00:00:00 CST 2011-->
    <script type="text/javascript">
    //clickClose---begin----
    function hidead(){
    document.getElementById("floatAd").style.display="none";
    }
    //clickClose---end----
    function floatAD() {
    var L=T=0
    var R= document.body.clientWidth-obj.offsetWidth
    var B = document.body.clientHeight-obj.offsetHeight
    obj.style.left = x + document.body.scrollLeft
    obj.style.top = y + document.body.scrollTop
    x = x + step*(xin?1:-1)
    if (x < L) { xin = true; x = L}
    if (x > R){ xin = false; x = R}
    y = y + step*(yin?1:-1)
    if (y < T) { yin = true; y = T }
    if (y > B) { yin = false; y = B }
    }
    </script> <table width="330" height="177" border="0" cellpadding="0" cellspacing="0" id="floatAd" style="position:absolute;overflow:hidden; ">
    <tr height="29">
    <td width="330" height="29" background="/floatAD/images/title.jpg">
    <div onclick="hidead();" style="float:right;margin-right:5px;cursor:pointer;margin-top:0px;display:inline;">
    <img src="/floatAD/images/1.jpg" border="0"/>
    </div>
    </td>
    </tr>
    <tr height="148">
    <a href="http://sh.ct10000.com/v3/workbench/tyt/tytExplain.jsp" target="_blank"><td style="cursor:pointer;background-image:url(/floatAD/images/cardAD.jpg);"></td></a>
    </tr>
    </table>
    <script type="text/javascript">
    //float---begin---
    var x = 50,y = 60
    var xin = true, yin = true
    var step = 1
    var delay = 1
    var obj=document.getElementById("floatAd")
    var itl= setInterval("floatAD()", delay)
    obj.onmouseover=function(){clearInterval(itl)}
    obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}
    //float---end---
    </script>
    </body>
    </html>[/code]
      

  3.   

    这个接口在12日17号以后停用,https://code.google.com/p/gears/wiki/GeolocationAPI这里有公告
      

  4.   


    The Google Gears Geolocation API will stop responding to requests on November 17, 2012. 是2012年11月17日停用。