![](/img/trans.png)
[英]The Google Maps API server rejected your request. Invalid request. Missing the 'size' parameter
[英]The Google Maps API server rejected your request
我正在開發一個應用程序,它在圖像上呈現谷歌地圖,如下所示
<img alt="Google Maps (Scotland)" src="http://maps.google.com/staticmap?size=480x200&maptype=mobile\&markers=55.9368450758,-3.03604939504,reda|55.9454374538,-3.18124534297,redb&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
地圖沒有渲染,當我右鍵單擊圖像源並單擊該URL時,我收到以下消息
“Google Maps API服務器拒絕了您的請求。此網站或IP無權使用此API密鑰。”
我已經檢查了https://code.google.com/apis/console上的API訪問權限,API密鑰似乎都是正確的。 只是想知道如何修復網站和IP位?
請參閱以下google API控制台中的設置
除“Google Maps API”外,請確保您已啟用“Static Maps API”服務。
確保您已啟用與Google地圖相關的服務 (“Google Maps Embed API”和“Static Maps API”),如下所示:
然后標記它們:
在新的布局中,您可以在此處找到它:
當我啟用“Google Maps Embed API”和“Static Maps API”時,它適用於我
確保在Simple API Access部分中有一個Browser鍵,並確保Referers
設置為Any referer allowed
在此處激活Google地圖關鍵字: https : //console.developers.google.com/apis/api/maps_embed_backend/overview?project = [yourproject]
它會立即啟用您的地圖。
從2018年6月起,您必須配置結算帳戶才能繼續使用Maps靜態API; 谷歌“捐贈”200美元/天的信用額度靜態API使用和計費
在網址中添加密鑰是不夠的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.