Google Maps API RefererNotAllowedError [英] Google Maps API RefererNotAllowedError

查看:185
本文介绍了Google Maps API RefererNotAllowedError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个用于Google Maps JavaScript API的Google密钥。



每件事情都可以使用,直到我添加到
接受来自这些HTTP引用者的请求



我以这种格式添加了引荐来源: *。example.com/*通过Credentials页面上的占位符。

然后API停止工作,并在js控制台中抛出此错误:

  Google Maps API错误:RefererNotAllowedMapError 

https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
您的网站网址将被授权:http://example.com/test/

脚本标记:

  http://maps.googleapis.com/maps/api/js?key=** ********* 

所以它似乎告诉我我需要指定确切的网址在引用者列表中。

但我认为使用 * 通配符的目的是让整个网站允许使用。



是否真的有必要指定您的网站上使用Map API的每个位置?

解决方案 <.c> *。example.com / * (example.com的所有子域名)不匹配示例.com / test / (它会匹配 www.example.com )。



您需要授权 example.com / *


I have created an Google key for use with the Google Maps JavaScript API.

Every thing works until I add to the credential under Accept requests from these HTTP referrers

I added the referrer in this format: *.example.com/* Per the placeholder on the Credentials page.

Then the API stops working and throws this error in the js console:

Google Maps API error: RefererNotAllowedMapError 

https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: http://example.com/test/

The call in the scripts tag on the site:

http://maps.googleapis.com/maps/api/js?key=***********

So it seems to be telling me I need to specify the exact url in the referer list.

But I thought the purpose of using the * wildcard was so the whole site would allow usage.

Is it really necessary to specify every single location on your website that will use the Map API ?

解决方案

*.example.com/* (all sub-domains of example.com) doesn't match example.com/test/ (it would match www.example.com though).

You need to authorize example.com/*

这篇关于Google Maps API RefererNotAllowedError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆