Google地方信息自动填充问题

时间:2019-02-19 01:30:26

标签: javascript google-places-api

我正在我的脚本上设置一个Google Places自动完成功能,并在我输入位置时收到此错误“您已超出此API的每日请求配额”

        var input = document.getElementById('np_autocomplete');             
        autocomplete  = new google.maps.places.Autocomplete(input);
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function(position) {
              var geolocation = {
                lat: position.coords.latitude,
                lng: position.coords.longitude
              };
              var circle = new google.maps.Circle({
                center: geolocation,
                radius: position.coords.accuracy
              });
              autocomplete.setBounds(circle.getBounds());
            });
        }               
        autocomplete.addListener('place_changed', this.fillInAddres);

        google.maps.event.addDomListener(input, 'keydown', function(event) { 
            if (event.keyCode === 13) {
                event.preventDefault(); 
            }
        });

0 个答案:

没有答案
相关问题