简体   繁体   English

显示此页面的 Google 地图未正确加载 Google 地图

[英]Google map showing this page didn't load Google Maps correctly

 <!-- <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script> --> <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initialize" async="" defer="defer" type="text/javascript"></script> var element = $(this); var map; function initialize(data) { var myCenter = new google.maps.LatLng(null,null) var gmarkers = []; var polyline = []; var data1=JSON.parse(data); var noData="No Data Found"; if(data1.last_call!='' && data1.last_call!=null) { $('#rep_call').text(data1.last_call); } else { $('#rep_call').text(noData); } if(data1.last_mail!='' && data1.last_mail!=null) { $('#rep_mail').text(data1.last_call); } else { $('#rep_mail').text(noData); } if(data1.last_sms!='' && data1.last_sms!=null) { $('#rep_sms').text(data1.last_sms); } else { $('#rep_sms').text(noData); } var locations = eval(data1.map_loc); var mapProp = {center: myCenter,zoom: 10,draggable: true,scrollwheel: true,mapTypeId: google.maps.MapTypeId.ROADMAP,streetViewControl: false}; map = new google.maps.Map(document.getElementById("map-canvas"), mapProp); var infowindow = new google.maps.InfoWindow(); var bounds = new google.maps.LatLngBounds(); var iconURLgreen = '<?=base_url()?>images/green.png'; var iconURLred = '<?=base_url()?>images/red.png'; for (i = 0; i < locations.length; i++) { if(locations[i][3] == 0) { var iconURL = iconURLred;var openStatus = 'red';} else { var iconURL = iconURLgreen;var openStatus = 'green';} var image = {url: iconURL,size: new google.maps.Size(29,38),origin: new google.maps.Point(0,0),anchor: new google.maps.Point(7,35)} marker = new google.maps.Marker({position: new google.maps.LatLng(locations[i][1], locations[i][2]),map: map,icon: image}); polyline.push(new google.maps.LatLng(locations[i][1], locations[i][2])); gmarkers.push(marker); bounds.extend(marker.position); google.maps.event.addListener(marker, 'click', (function (marker, i) { return function () { //infowindow.setContent(locations[i][0]); //infowindow.open(map, marker); } })(marker, i)); google.maps.event.addListener(map, 'click', function() { infowindow.close(); }); } map.fitBounds(bounds); var polyline = new google.maps.Polyline({ path: polyline, strokeColor: "#337ab7", strokeOpacity: 1.0, strokeWeight: 10, map: map }); polyline.setMap(map); }

I have tried this code, in YOUR_API_KEY place i have placed the actual api key still also it is showing some alert like This page didn't load Google Maps correctly.我已经尝试过这段代码,在 YOUR_API_KEY 的地方我已经放置了实际的 api 密钥,它仍然显示一些警报,例如此页面未正确加载 Google 地图。 how to remove this alert.如何删除此警报。 can anyone help me.谁能帮我。 any help could be appreciated.任何帮助都将不胜感激。

Make sure you are using correct API Key and open console to verify.确保您使用正确的API 密钥并打开控制台进行验证。

Might be possible miss this or any other option可能会错过这个或任何其他选择

You must enable Billing on the Google Cloud Project

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谷歌地图错误:糟糕! 出了点问题。 此页面未正确加载 Google 地图 - Google Maps error: Oops! Something went wrong. This page didn't load Google Maps correctly Google Maps错误:此页面未正确加载Google Maps。 有关技术详细信息,请参见JavaScript控制台。 - Google Maps Error :This page didn't load Google Maps correctly. See the JavaScript console for technical details 此页面未正确加载 Google 地图。 有关技术细节,请参阅 JavaScript 控制台。之前在 2 秒内显示 map - This page didn't load Google Maps correctly. See the JavaScript console for technical details.before that showed map in 2s 谷歌地图显示“仅供开发者使用”和“此页面无法正确加载谷歌地图”。 反应 - Google Maps showing "For Developers purposes only" and "This page can't load Google Maps correctly." react 此页面未正确加载 Google 地图。 有关技术详细信息,请参阅 JavaScript 控制台 - This page didn't load Google Maps correctly. See the JavaScript console for technical details 此页面未正确加载 Google 地图。 有关技术详细信息,请参阅 JavaScript 控制台 - This page didn't load Google Maps correctly. See the JavaScript console for technical details google map 在 html 中显示无法正确加载地图 - google map showing cant load maps correctly in html 哎呀!有些不对劲。此页面未正确加载Google地图。有关技术详细信息,请参阅JavaScript控制台 - Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details Google Maps API在Ajax页面加载中显示灰色地图 - Google Maps API showing grey map on ajax page load 如何修复“此页面无法正确加载谷歌地图”错误 - How to fix "this page can't load google maps correctly" error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM