【发布时间】:2017-10-27 16:05:12
【问题描述】:
对不起,我不是一个 Javascript 程序员,所以这是一个相当菜鸟的问题。但是我在尝试将 Google Earth Engine api 文件导入另一个 javascript 文件时遇到了麻烦。 Earth Engine 存储库中的所有示例都使用 html 中的 <script src="/static/ee_api_js.js"></script> 来访问 Earth Engine 功能,但我想避免使用 html。
我尝试遵循标准的 Javascript 程序。这是我得到的代码。
var mymod = require('/../javascript/ee_api_js');
var image = mymod.Image('srtm90_v4');
var path = image.getDownloadURL({
'scale': 30,
'crs': 'EPSG:4326',
'region': '[[-120, 35], [-119, 35], [-119, 34], [-120, 34]]'
});
print(path);
我得到的错误信息是:
var image = mymod.Image('srtm90_v4');
^
TypeError: mymod.Image is not a function
原始的ee_api_js.js 文件位于github repo 中:
https://github.com/google/earthengine-api/tree/master/javascript/build
不确定为什么这个模块没有正确导入?任何想法。
【问题讨论】:
标签: javascript import module google-earth-engine