我正在尝试将从 .js 文件 1(即 /events.js)中填充的变量值导出async function
到 .js 文件 2(即 app/loader.js)中的另一个函数
./events.js
async function mapViewClickHandler(event) {
// get coords A
var coordinatesAx;
var coordinatesAy;
var coordinatesAx = ntoResults[0].mapPoint.latitude;
var coordinatesAy = ntoResults[0].mapPoint.longitude;
var mapPointCoordsA = coordinatesAx + "," + coordinatesAy;
console.log("start coords A:" + mapPointCoordsA);
// end get coords A
.............
}
./loader.js
function initPoints(evt) {
// need to bring vals here
var mapPointCoordsA = coordinatesAx + "," + coordinatesAy;
console.log("start coords A:" + mapPointCoordsA);
}