Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.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 AngularJS,加载谷歌地图API时暂停_Javascript_Angularjs_Google Maps_Google Maps Api 3 - Fatal编程技术网

Javascript AngularJS,加载谷歌地图API时暂停

Javascript AngularJS,加载谷歌地图API时暂停,javascript,angularjs,google-maps,google-maps-api-3,Javascript,Angularjs,Google Maps,Google Maps Api 3,我正在使用加载GoogleMapsAPI,但加载API脚本时会暂停3-4秒。因此页面上的所有内容都已加载->3-4秒暂停->API脚本开始加载->地图显示 看起来它只是在等待某个计时器事件: 谷歌地图配置代码段: uiGmapGoogleMapApiProvider.configure({ key: 'xxxxxxxxxx', v: '3', libraries: 'geocoder', preventLoad: false, china: fa

我正在使用加载GoogleMapsAPI,但加载API脚本时会暂停3-4秒。因此页面上的所有内容都已加载->3-4秒暂停->API脚本开始加载->地图显示

看起来它只是在等待某个计时器事件:

谷歌地图配置代码段:

  uiGmapGoogleMapApiProvider.configure({
    key: 'xxxxxxxxxx',
    v: '3',
    libraries: 'geocoder',
    preventLoad: false,
    china: false,
    transport: 'https'
  });
在此处映射负载:

    <div id="shopMap" ng-init="initShopMap()"></div>

你知道为什么会发生这种延迟吗?非常感谢您的任何提示,谢谢✨

结果是,该项目中的api加载错误,index.htm中没有这一行:

 <script async defer
      src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
    </script>

我想知道如果没有这条线,地图是如何工作的:)

 <script async defer
      src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
    </script>