<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                使用[微信考勤百度地圖定位](http://blog.csdn.net/xuexiaodong009/article/details/48345445)中的方法定位,可以定位到一個具體的位置某省某市某區某路某號,總是讓人感覺顯示不是很友好,如果直接顯示,軟件園,科技園之類的是不是更好呢?于是查了一下百度地圖的相關文檔,其實也很簡單。百度有附近的功能,還有地址解析的功能,都可以實現。 例如我就是用了Geocoder服務,實現了需要的效果。 **核心代碼:** ~~~ var map = new BMap.Map("allmap"); var circle = new BMap.Geolocation(); circle.getCurrentPosition(locationResult); // map.addOverlay(circle); var tempGeocoder = new BMap.Geocoder(); function locationResult(geolocationResult) { var Status = this.getStatus() if (Status == 0)//檢索成功。對應數值“0”。 { $("#lng").val(geolocationResult.point.lng); $("#lat").val(geolocationResult.point.lat); var address = geolocationResult.address; $("#city").val(address.city); $("#district").val(address.district); $("#street").val(address.street); var text = ""; if (address.province != address.city) { text += address.province; } text += address.city + address.district + address.street + address.street_number; tempGeocoder.getLocation(geolocationResult.point, locationResultcallback, { poiRadius: 500, numPois: 5 }); // $("#province").val(address.province); $("#address").val(text); } else { alert("定位失敗錯誤碼" + Status) } } function locationResultcallback(GeocoderResult) { var yyy = GeocoderResult.surroundingPois; if (GeocoderResult.surroundingPois.length > 0) { var address2 = GeocoderResult.surroundingPois[0].title; if (address2) { var text = ""; var province = $("#province").val(); var city = $("#city").val(); if (province != city) { text += province; } text += city; $("#address").val(text + address2); } } } ~~~ 實現效果: ![](https://box.kancloud.cn/2016-01-14_569757de785ff.jpg) **這樣總比顯示陜西省西安市雁塔區西三環好好的多吧。**
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看