Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当Google Maps+;其他库是否已满负荷?_Javascript_Jquery_Html_Google Maps - Fatal编程技术网

Javascript 当Google Maps+;其他库是否已满负荷?

Javascript 当Google Maps+;其他库是否已满负荷?,javascript,jquery,html,google-maps,Javascript,Jquery,Html,Google Maps,我加载google map api并使用回调参数执行init函数initMap(): <script async="" defer="" src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxx&amp;callback=initMap"></script> 但是initMap()在页面加载时不起作用: ReferenceError: Can't find variable: RichMarker

我加载google map api并使用
回调
参数执行init函数
initMap()

<script async="" defer="" src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxx&amp;callback=initMap"></script>
但是
initMap()在页面加载时不起作用:

ReferenceError: Can't find variable: RichMarker
(我知道这个脚本可以工作,因为我可以用一个菜单更新地图,该菜单使用AJAX更新地图,在本例中它可以工作。)

我猜这是因为init函数是在
js-rich-marker
完全加载之前执行的

我尝试在加载所有内容时调用init函数,但仍然不正常

document.addEventListener("DOMContentLoaded", function(event){
  initMap();
});

$(window).load(function() {
   initMap();
});

$(window).bind("load", function() {
   // code goes here
});
我怎样才能调用一个函数&所有东西都加载了

window.document.onload= function(e){

}
window.onload = function(e){

}
并调用下一个js rich marker
示例:

窗口。onload
是解决方案`。更多信息请点击此处:
window.document.onload= function(e){

}
window.onload = function(e){

}