簡體   English   中英

vue2-google-maps 如何使用 Embed API“放置模式”

[英]vue2-google-maps how to use Embed API "place mode"

我在vue2-google-maps 中使用谷歌地圖 javascript api。 我的項目運行良好,唯一的問題是我超出了我的請求配額。

如此處所述https://developers.google.com/maps/documentation/embed/guide#basic_map_modes我可以使用“放置模式”或“查看模式”來獲得無限使用。 這些模式非常適合我的需要。

有人知道如何在我的 vuejs2 項目中設置它們嗎?

看起來 vue2-google-maps 不支持 Embed API 位置模式集成,但是使用此 API 所需要做的就是在 iframe 中調用它。

使用您自己的 API 密鑰嘗試這個簡單的 jsfiddle: https ://jsfiddle.net/98ebrhoy/

<div id="app">
  <map></map>
</div>

Vue.component('map', {
  template: '<h1>Map</h1><iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=&q=Space+Needle,Seattle+WA"></iframe>'
});

var vm = new Vue({
  el: '#app'
});

希望這可以幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM