Places api 提供控制台上不允许的引荐来源网址

Places api gives referrer not allowed on console

假设我的站点是 www.example.com,我有一个页面 map.php,我想在其中访问地点 api。我已经添加了所有凭据以及 HTTP 引荐来源网址作为示例。com/map.php。 但它仍然给我 Referrer Not Allowed 错误。

<script src="https://maps.googleapis.com/maps/api/js?key=****&libraries=places"></script>
        <script type="text/javascript">
            function initialize() {
                var options = {
                    componentRestrictions: {country: "in"}
                };
                var input = document.getElementById('txtcity');
                new google.maps.places.Autocomplete(input, options);
            }
            google.maps.event.addDomListener(window, 'load', initialize);

        </script>

尝试添加所有类型的网址,例如:

.example.com/

http://example.com/*

http://www.example.com/*

那肯定行