import { __awaiter, __generator } from "tslib";
import esriLoader from 'esri-loader';
var MapLoader = /** @class */ (function () {
    function MapLoader(url) {
        if (url === void 0) { url = ''; }
        this.url = url;
    }
    MapLoader.prototype.getUrl = function () {
        return this.url;
    };
    MapLoader.prototype.loadCss = function (cssUrl) {
        if (cssUrl === void 0) { cssUrl = this.url + 'esri/css/main.css'; }
        esriLoader.loadCss(cssUrl);
    };
    MapLoader.prototype.loadModules = function (modules, url) {
        if (url === void 0) { url = this.url + 'init.js'; }
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, esriLoader.loadModules(modules, {
                            url: url
                        })];
                    case 1: return [2 /*return*/, _a.sent()];
                }
            });
        });
    };
    return MapLoader;
}());
// const mapLoader: MapLoader = new MapLoader(store.getters.mapUrl.ESRI_API_URL);
var mapLoader = new MapLoader(process.env.ARCGIS_API);
export default mapLoader;
