Google地图什么也没显示

时间:2020-09-09 05:04:40

标签: javascript html dictionary

http://165.232.77.75:8080/contact.html不在此网站上。尽管我已经替换了真实的API密钥,但它无法正确加载。我什至已经在Google Cloud Platform的“限制并重命名API密钥”中进行了正确配置。顺便说一句,这是简单的静态站点。它与后端和数据库无关。这是我的代码:

               <script>
                    function initMap() {
                        var uluru = {
                            lat: -25.363,
                            lng: 131.044
                        };
                        var grayStyles = [{
                            featureType: "all",
                            stylers: [{
                                saturation: -90
                            }, {
                                lightness: 50
                            }]
                        }, {
                            elementType: 'labels.text.fill',
                            stylers: [{
                                color: '#ccdee9'
                            }]
                        }];
                        var map = new google.maps.Map(document.getElementById('map'), {
                            center: {
                                lat: -31.197,
                                lng: 150.744
                            },
                            zoom: 9,
                            styles: grayStyles,
                            scrollwheel: false
                        });
                    }
                </script>
                <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQSuGVy_L5m4vVVI55pm_X8I1Y0MDk72s&callback=initMap" type="text/javascript"></script>

然后,出现消息图像,“糟糕!出了点问题。 该页面未正确加载Google Maps。有关技术细节,请参见JavaScript控制台。”以及“限制和重命名API密钥”的图片。

enter image description here

enter image description here

enter image description here

enter image description here

0 个答案:

没有答案
相关问题