Questions tagged «arcgis-js-api»

6
导入ECMAScript 6时出现“未捕获的SyntaxError:无法在模块外部使用import语句”
我正在使用ArcGIS JSAPI 4.12,并希望使用“ 空间幻觉”在地图上绘制军事符号。 当我添加milsymbol.js到脚本时,控制台返回错误 未捕获的SyntaxError:无法在模块外部使用import语句` 所以我添加type="module"到脚本中,然后返回 未捕获的ReferenceError:未定义ms 这是我的代码: <link rel="stylesheet" href="https://js.arcgis.com/4.12/esri/css/main.css"> <script src="https://js.arcgis.com/4.12/"></script> <script type="module" src="milsymbol-2.0.0/src/milsymbol.js"></script> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/MapImageLayer", "esri/layers/FeatureLayer" ], function (Map, MapView, MapImageLayer, FeatureLayer) { var symbol = new ms.Symbol("SFG-UCI----D", { size: 30 }).asCanvas(3); var map = new Map({ basemap: "topo-vector" }); var view = …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.