Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.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
Angularjs 在RequireJS中使用Google地图与异步_Angularjs_Google Maps_Requirejs - Fatal编程技术网

Angularjs 在RequireJS中使用Google地图与异步

Angularjs 在RequireJS中使用Google地图与异步,angularjs,google-maps,requirejs,Angularjs,Google Maps,Requirejs,我在中国,我的项目是德语的。当我开发时,我希望使用: 对于我当地的发展,那么在德语中,它可以切换到 因此,我将require.config.js放在如下位置: require.config({ // List of all the dependencies paths: { google: [ '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false',

我在中国,我的项目是德语的。当我开发时,我希望使用:

对于我当地的发展,那么在德语中,它可以切换到

因此,我将require.config.js放在如下位置:

require.config({
    // List of all the dependencies
    paths: {
        google: [
            '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false',
            '//ditu.google.cn/maps/api/js?v=3.exp&sensor=false'
        ]
    }
})
当第一个链接超时时,它将尝试第二个链接。但当我运行我的项目时,我会出现以下错误:

未能对“文档”执行“写入”:除非显式打开,否则无法从异步加载的外部脚本写入文档


如何解决这个问题?

我使用angularJS和GoogleMaps(异步加载,在指令中)。我没有使用requireJS。签出:尤其是index2.html部分。也许你会有一些想法。对不起,这似乎不是我想要的…我需要使用超时来调整url,这取决于巫婆的环境。你找到解决方案了吗?