久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      vuejs項(xiàng)目怎么實(shí)現(xiàn)百度地圖顯示

      實(shí)現(xiàn)方法:1、在“百度地圖開發(fā)平臺(tái)”中申請(qǐng)秘鑰;2、在“index.html”中使用script標(biāo)簽引入地圖鏈接;3、在“APP.vue”中放入相關(guān)js代碼實(shí)現(xiàn)百度地圖。

      vuejs項(xiàng)目怎么實(shí)現(xiàn)百度地圖顯示

      本教程操作環(huán)境:windows7系統(tǒng)、vue2.9.6版,DELL G3電腦。

      vue在項(xiàng)目中使用百度地圖

      第一步,去百度地圖開發(fā)平臺(tái)http://lbsyun.baidu.com/ 申請(qǐng)秘鑰。

      第二步在項(xiàng)目中引入,具體如下

      vuejs項(xiàng)目怎么實(shí)現(xiàn)百度地圖顯示

      其中index.html存放地圖鏈接,代碼如下

      vuejs項(xiàng)目怎么實(shí)現(xiàn)百度地圖顯示

      然后在APP.vue里面實(shí)現(xiàn),代碼如下

      <template>  <div id="app">   <div id="allmap" ref="allmap"></div>   <router-view></router-view>  </div> </template>    <script> export default {  name: 'App',  methods:{   map(){    let map =new BMap.Map(this.$refs.allmap); // 創(chuàng)建Map實(shí)例    map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);// 初始化地圖,設(shè)置中心點(diǎn)坐標(biāo)和地圖級(jí)別    map.addControl(new BMap.MapTypeControl({//添加地圖類型控件     mapTypes:[      BMAP_NORMAL_MAP,      BMAP_HYBRID_MAP     ]}));    map.setCurrentCity("北京");// 設(shè)置地圖顯示的城市 此項(xiàng)是必須設(shè)置的    map.enableScrollWheelZoom(true); //開啟鼠標(biāo)滾輪縮放   }     },  mounted(){   this.map()     } } </script>    <style> #app {  font-family: 'Avenir', Helvetica, Arial, sans-serif;  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;  text-align: center;  color: #2c3e50;  margin-top: 60px; } #allmap{  height: 500px;  overflow: hidden;    } </style>

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)