Javascript 在Wordpress中排队后,如何显示我的google API地图

Javascript 在Wordpress中排队后,如何显示我的google API地图,javascript,php,wordpress,google-maps,Javascript,Php,Wordpress,Google Maps,我的functions.php中有这段代码,它在我的页面源代码中显示了我的API键和map_script.js function google_maps_api() { wp_register_script( 'googlemap', 'https://maps.googleapis.com/maps/api/js?key=MYAPIKEY&signed_in=true&callback=initMap',true); wp_register_script(

我的functions.php中有这段代码,它在我的页面源代码中显示了我的API键和map_script.js

function google_maps_api() { 
    wp_register_script( 'googlemap', 'https://maps.googleapis.com/maps/api/js?key=MYAPIKEY&signed_in=true&callback=initMap',true); 
    wp_register_script( 'map-script', '/js/map_script.js',true);
if( is_page( 'To the Nations Worldwide' ) ) {
    wp_enqueue_script('googlemap');
}
if( is_page( 'To the Nations Worldwide' ) ) { 
   wp_enqueue_script('map-script'); }
} 
    add_action( 'wp_enqueue_scripts', 'google_maps_api' );
这在www.tothenationsworldwide.com的页面源中显示了我主页上的所有内容,但地图没有显示

我试着在CSS中添加这个

body,html,#map-canvas{
   height:100%;
   min-height: 100%;
   width: 100%;
   margin: 0px;
   padding: 0px
 }
在我的页面上,我想让地图显示出来

<script type='text/javascript' src='http://www.tothenationsworldwide.com/js/map_script.js?ver=4.3.1'></script>
<div id="map-canvas"></div>

不走运,我需要知道下一步要做什么才能显示我的地图


谢谢

你试过地图的固定尺寸吗?只是为了测试。另外:如果我试图打开你的map_script.js URL,我会得到一个找不到的响应如何为地图编写一个固定大小?我已经在我的计算机上测试了它作为一个html代码,代码运行良好。我修复了map_script.js不显示的问题,忘记了get_template_directory_uri()/js/map_script.js'只尝试以下内容:
#map canvas{width:800px;height:400px;}
(body和html没有任何内容)-尝试在浏览器控制台中查找错误日志您太棒了。非常感谢你!