1. <nobr id="easjo"><address id="easjo"></address></nobr>

      <track id="easjo"><source id="easjo"></source></track>
      1. 
        

      2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
      3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>
          貴州做網站公司
          貴州做網站公司~專業!靠譜!
          10年網站模板開發經驗,熟悉國內外開源網站程序,包括DEDECMS,WordPress,ZBlog,Discuz! 等網站程序,可為您提供網站建設,網站克隆,仿站,網頁設計,網站制作,網站推廣優化等服務。我們專注高端營銷型網站,企業官網,集團官網,自適應網站,手機網站,網絡營銷,網站優化,網站服務器環境搭建以及托管運維等。為客戶提供一站式網站解決方案?。?!

          騰訊地圖-自動獲取當前城市位置+搜索功能

          來源:互聯網轉載 時間:2024-01-29 08:28:10
          <template> <p> <p style="width: 630px; height: 530px; top: -20px" v-if="getLocationInfoDialog"></p> <input type="hidden" /> <input type="hidden" /> <input type="hidden" /> <input type="hidden" /> <input type="hidden" /> <el-row style="text-align:center"> <el-button style="width:100px" type="warning" @click="addLocation()">確認</el-button> </el-row>
          <el-input v-model="adressKeywords" @input="getCoordinates()" @change="getCoordinates()" clearable placeholder="請輸入地址"></el-input> </p></template><script>var geocoder, map, marker = null;export default { data() { return { adressKeywords:'', getLocationInfoDialog: true, childValue: { storeAddress1: '', //地址 longitude1: '', //經度 latitude1: '', //緯度 city1: '', //城市 province1: ''//省 } }; },
          created () { },
          methods: { onSearch(value) { geocoder.getLocation(value); }, //通過$emit方法將地圖的經緯度傳到上一個頁面 addLocation() { this.childValue.longitude1 = document.getElementById('longitude1').innerText; this.childValue.latitude1 = document.getElementById('latitude1').innerText; this.childValue.storeAddress1 = document.getElementById('storeAddress1').innerText; this.childValue.city1 = document.getElementById('city1').innerText; this.childValue.province1 = document.getElementById('province1').innerText;
          this.$emit('storePropertyAdd', this.childValue); var longitude1=this.childValue.longitude1; var latitude1=this.childValue.latitude1; var storeAddress1=this.childValue.storeAddress1; if(longitude1&&latitude1&&storeAddress1!=null){ this.$emit('hideAddDialog'); } },
          getLocationInfo() { this.getLocationInfoDialog = true; //input獲得焦點打開彈窗 },
          getCoordinates() { // 獲取當前地理位置信息 let data = { key: "XXX" //申請的密鑰 }; let url = "https://apis.map.qq.com/ws/location/v1/ip"; //地理位置信息接口
          let secondUrl = "https://apis.map.qq.com/ws/geocoder/v1/?address=" + this.adressKeywords; //根據輸入地址獲取對應的經緯度信息
          data.output = "jsonp";
          this.$jsonp(this.adressKeywords == '' ? url : secondUrl, data)
          .then(res => { this.childValue.longitude1 = res.result.location.lng //經度 this.childValue.latitude1 = res.result.location.lat //緯度 }) .catch(error => { console.log(error); }); // 根據關鍵字重新獲取地理位置 this.init()
          },
          init() { console.log('調用了init方法');
          var address = ''; var longitude = ''; var latitude = ''; var city = ''; var province ='';
          var center = new qq.maps.LatLng(this.childValue.latitude1 ? this.childValue.latitude1 : 31.300967383561886, this.childValue.longitude1 ? this.childValue.longitude1 : 120.58501872161287);
          var map = new qq.maps.Map(document.getElementById('map'), { //獲取頁面id center: center, zoom: 13, disableDefaultUI: true }); var marker = new qq.maps.Marker({ position: center, map: map }); var infoWin = new qq.maps.InfoWindow({ map: map }); var geocoder = new qq.maps.Geocoder({ complete: function (res) { address = res.detail.address; city = res.detail.addressComponents.city; province = res.detail.addressComponents.province; document.getElementById('storeAddress1').innerText = address; document.getElementById('city1').innerText =city; document.getElementById('province1').innerText = province; } });
          //點擊地圖事件 qq.maps.event.addListener(map, 'click', function (event) { //console.log('event',event) longitude = event.latLng.getLat(); latitude = event.latLng.getLng(); let lat = new qq.maps.LatLng(longitude, latitude); geocoder.getAddress(lat); setTimeout(() => { infoWin.open(); infoWin.setContent('<p style="text-align:center;white-space:nowrap;">' + address + '</p>'); infoWin.setPosition(event.latLng); }, 500); document.getElementById('longitude1').innerText = longitude; document.getElementById('latitude1').innerText = latitude; }); // this.adressKeywords = '' } }, mounted() { this.getCoordinates()
          setTimeout(()=>{ this.init() },1000) }};</script>

          <style></style>
          標簽:城市搜索-

          網絡推廣與網站優化公司(網絡優化與推廣專家)作為數字營銷領域的核心服務提供方,其價值在于通過技術手段與策略規劃幫助企業提升線上曝光度、用戶轉化率及品牌影響力。這...

          在當今數字化時代,公司網站已成為企業展示形象、傳遞信息和開展業務的重要平臺。然而,對于許多公司來說,網站建設的價格是一個關鍵考量因素。本文將圍繞“公司網站建設價...

          在當今的數字化時代,企業網站已成為企業展示形象、吸引客戶和開展業務的重要平臺。然而,對于許多中小企業來說,高昂的網站建設費用可能會成為其發展的瓶頸。幸運的是,隨...

          在windows安裝器里,使用bootsect.exe更新引導是什么意思,有什么作用,有必要開啟嗎?如有必要,此更新引導指將新安裝的系統添加到引導菜單。如果您不選擇它,您將無法選擇啟動新安裝的系統...

          什么是保險絲?保險絲的作用:過流保護和過熱保護。用于過電流保護的熔斷器通常稱為熔斷器(也稱為限流熔斷器)。用于過熱保護的保險絲通常稱為艾默生電源柜停電告警怎么做?我們最常見的問題是艾默生UPS電源保險絲損壞。艾默生UPS電源保險絲損壞并不像有些人想的那樣,說明啟動后沒有反應。大多數情況下表現為電源開關打開后,艾默生UPS電源處于逆變狀態,無法轉入市電穩壓狀態。由于電源的熔絲管位于市電的進線處,熔絲...

          天地圖是什么坐標系?天圖采用gcs2000坐標系。國家開始封禁,谷歌地球之后,這些,地理類頭條號還能生存嗎?我最近也發現了這個問題。谷歌地圖的推出可以促進中國地圖產業的提升。事實上,這是件好事。沒有必要禁止谷歌地圖。此外,我們在國外看到的更清楚。沒有必要禁止它。另外,我們在谷歌地球上看不到任何有價值的軍事機密。最好是向喜歡學習電子地理的朋友開放]總之,要禁止谷歌地圖,目前沒有對等的替代品,這是歷史...

          TOP
          国产初高中生视频在线观看|亚洲一区中文|久久亚洲欧美国产精品|黄色网站入口免费进人
          1. <nobr id="easjo"><address id="easjo"></address></nobr>

              <track id="easjo"><source id="easjo"></source></track>
              1. 
                

              2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
              3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>