<script>
function openPopupWindow() {
var winWidth=570;
var winHeight=700;
var left = (screen.width-winWidth)/2;
var top = (screen.height-winHeight)/2;
window.open('https://console.cloud.google.com/google/maps-hosted', 'Quick Start Widget',
'resizable=yes,width='+winWidth+',height='+winHeight+',left='+left+',top='+top);
return false;
}
</script>
<!-- CTA to generate Google Maps API Key -->
<button type="button" onClick="openPopupWindow()" style="color: white; background-color: #1a73e8" href="#">
Get an API Key
</button>
實際運作情況:
使用者點選按鈕後,快速入門小工具會在彈出式視窗開啟,並在使用者隨著引導執行步驟時,完成下列工作:
建立 Google 帳戶和專案 (如果還沒有)。
啟用 Google 地圖平台 API。
產生 API 金鑰,使用者可複製並貼進外掛程式的設定。
如果外掛程式使用者已有 Google 帳戶和專案,小工具會導向 Google Cloud 控制台的「憑證」頁面,使用者可在該處取得現有的 API 金鑰,或建立新金鑰。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-04-18 (世界標準時間)。"],[],[],null,["# Quickly onboard Google Maps Platform plugin users\n\n\u003cbr /\u003e\n\n[](/static/maps/third-party-platforms/images/quickstart-widget.png)\n\nIf you're developing a Google Maps Platform plugin for\nplatforms such as WordPress, Shopify, Magento, and others, this topic\ndescribes how to quickly onboard plugin users to Google Maps Platform and\ngenerate an API key.\n\nThe API key, which your plugin needs to send with each request to\nGoogle Maps Platform, is tied to the user's Google account and\nbilling information and unlocks access to the map-building features\nin your plugin.\n\nTo help plugin users quickly generate an API key, provide a link or button\nthat launches the Quick Start Widget, a convenient popup window that\nwalks users through a few simple steps. The Quick Start Widget also\nkeeps plugin users in your platform rather than sending them off to the\nGoogle Cloud console to perform those tasks in multiple windows.\n\nLaunch the Quick Start Widget\n-----------------------------\n\nThe Quick Start Widget is just a web page whose window size you can\ncontrol with a JavaScript `window.open` call. For example: \n\n```gdscript\n\u003cscript\u003e\n function openPopupWindow() {\n var winWidth=570;\n var winHeight=700;\n var left = (screen.width-winWidth)/2;\n var top = (screen.height-winHeight)/2;\n\n window.open('https://console.cloud.google.com/google/maps-hosted', 'Quick Start Widget',\n 'resizable=yes,width='+winWidth+',height='+winHeight+',left='+left+',top='+top);\n return false;\n }\n\u003c/script\u003e\n\n\u003c!-- CTA to generate Google Maps API Key --\u003e\n\u003cbutton type=\"button\" onClick=\"openPopupWindow()\" style=\"color: white; background-color: #1a73e8\" href=\"#\"\u003e\n Get an API Key\n\u003c/button\u003e\n```\n\nSee it in action:\nGet an API Key\n\nWhen a user clicks the button, the Quick Start Widget opens in a popup\nwindow and does the following as the user moves through the widget:\n\n- Creates a Google account and project, if the user doesn't already have those.\n- Enables Google Maps Platform APIs.\n- Generates an API key for users to copy and paste into the plugin configuration.\n\nIf the plugin user already has a Google account and project, the widget\ntakes them to the \"Credentials\" page in the Google Cloud console, where\nthey can get an existing API key or create a new one.\n\nYou can point your plugin users to the\n[About the Quick Start Widget](/maps/third-party-platforms/quick-start-widget-users)\ntopic for more information.\n\nFrequently asked questions\n--------------------------\n\n### Do I have to pay to use the Quick Start Widget?\n\nNo. The Quick Start Widget is free and available to all developers\nto simplify Google Maps Platform onboarding.\n\n### Can the Quick Start Widget only be used on WordPress and Shopify?\n\nThe Quick Start Widget can be used on any third-party website, not just on\nwebsite builders or ecommerce sites.\n\n### Can the third-party platform view the billing information a user enters?\n\nAfter users authenticate with Google, their billing and other information is accessible\nonly to them. Third-party platforms and plugin developers cannot access that information.\n\n### Can I use my existing project and API key?\n\nIf you have an existing Google Maps Platform account, the Quick Start Widget\nredirects you to the to the Google Cloud console where you can either use an existing API key\nor generate a new one.\n\n### How do plugin users secure their API keys?\n\nThe [API security best practices](/maps/api-security-best-practices)\ntopic provides guidance on securing an API key. After using the\nQuick Start Widget, users also receive an email with instructions and\na link to the Google Cloud console to secure their API key."]]